// source: spine/net/url.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!
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var spine_options_pb = require('../../spine/options_pb.js');
goog.object.extend(proto, spine_options_pb);
goog.exportSymbol('proto.spine.net.Uri', null, global);
goog.exportSymbol('proto.spine.net.Uri.Authorization', null, global);
goog.exportSymbol('proto.spine.net.Uri.Protocol', null, global);
goog.exportSymbol('proto.spine.net.Uri.Protocol.ProtocolCase', null, global);
goog.exportSymbol('proto.spine.net.Uri.QueryParameter', null, global);
goog.exportSymbol('proto.spine.net.Uri.Schema', null, global);
goog.exportSymbol('proto.spine.net.Url', 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.spine.net.Url = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.spine.net.Url, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.spine.net.Url.displayName = 'proto.spine.net.Url';
}
/**
* 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.spine.net.Uri = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.spine.net.Uri.repeatedFields_, null);
};
goog.inherits(proto.spine.net.Uri, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.spine.net.Uri.displayName = 'proto.spine.net.Uri';
}
/**
* 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.spine.net.Uri.Protocol = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, proto.spine.net.Uri.Protocol.oneofGroups_);
};
goog.inherits(proto.spine.net.Uri.Protocol, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.spine.net.Uri.Protocol.displayName = 'proto.spine.net.Uri.Protocol';
}
/**
* 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.spine.net.Uri.Authorization = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.spine.net.Uri.Authorization, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.spine.net.Uri.Authorization.displayName = 'proto.spine.net.Uri.Authorization';
}
/**
* 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.spine.net.Uri.QueryParameter = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.spine.net.Uri.QueryParameter, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.spine.net.Uri.QueryParameter.displayName = 'proto.spine.net.Uri.QueryParameter';
}
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.spine.net.Url.prototype.toObject = function(opt_includeInstance) {
return proto.spine.net.Url.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.spine.net.Url} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.net.Url.toObject = function(includeInstance, msg) {
var f, obj = {
spec: 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.spine.net.Url}
*/
proto.spine.net.Url.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.spine.net.Url;
return proto.spine.net.Url.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.spine.net.Url} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.spine.net.Url}
*/
proto.spine.net.Url.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setSpec(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.spine.net.Url.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.spine.net.Url.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.spine.net.Url} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.net.Url.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getSpec();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
};
/**
* optional string spec = 3;
* @return {string}
*/
proto.spine.net.Url.prototype.getSpec = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* @param {string} value
* @return {!proto.spine.net.Url} returns this
*/
proto.spine.net.Url.prototype.setSpec = function(value) {
return jspb.Message.setProto3StringField(this, 3, value);
};
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.spine.net.Uri.repeatedFields_ = [6];
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.spine.net.Uri.prototype.toObject = function(opt_includeInstance) {
return proto.spine.net.Uri.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.spine.net.Uri} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.net.Uri.toObject = function(includeInstance, msg) {
var f, obj = {
protocol: (f = msg.getProtocol()) && proto.spine.net.Uri.Protocol.toObject(includeInstance, f),
auth: (f = msg.getAuth()) && proto.spine.net.Uri.Authorization.toObject(includeInstance, f),
host: jspb.Message.getFieldWithDefault(msg, 3, ""),
port: jspb.Message.getFieldWithDefault(msg, 4, ""),
path: jspb.Message.getFieldWithDefault(msg, 5, ""),
queryList: jspb.Message.toObjectList(msg.getQueryList(),
proto.spine.net.Uri.QueryParameter.toObject, includeInstance),
fragment: jspb.Message.getFieldWithDefault(msg, 7, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.spine.net.Uri}
*/
proto.spine.net.Uri.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.spine.net.Uri;
return proto.spine.net.Uri.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.spine.net.Uri} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.spine.net.Uri}
*/
proto.spine.net.Uri.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new proto.spine.net.Uri.Protocol;
reader.readMessage(value,proto.spine.net.Uri.Protocol.deserializeBinaryFromReader);
msg.setProtocol(value);
break;
case 2:
var value = new proto.spine.net.Uri.Authorization;
reader.readMessage(value,proto.spine.net.Uri.Authorization.deserializeBinaryFromReader);
msg.setAuth(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setHost(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.setPort(value);
break;
case 5:
var value = /** @type {string} */ (reader.readString());
msg.setPath(value);
break;
case 6:
var value = new proto.spine.net.Uri.QueryParameter;
reader.readMessage(value,proto.spine.net.Uri.QueryParameter.deserializeBinaryFromReader);
msg.addQuery(value);
break;
case 7:
var value = /** @type {string} */ (reader.readString());
msg.setFragment(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.spine.net.Uri.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.spine.net.Uri.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.spine.net.Uri} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.net.Uri.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getProtocol();
if (f != null) {
writer.writeMessage(
1,
f,
proto.spine.net.Uri.Protocol.serializeBinaryToWriter
);
}
f = message.getAuth();
if (f != null) {
writer.writeMessage(
2,
f,
proto.spine.net.Uri.Authorization.serializeBinaryToWriter
);
}
f = message.getHost();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getPort();
if (f.length > 0) {
writer.writeString(
4,
f
);
}
f = message.getPath();
if (f.length > 0) {
writer.writeString(
5,
f
);
}
f = message.getQueryList();
if (f.length > 0) {
writer.writeRepeatedMessage(
6,
f,
proto.spine.net.Uri.QueryParameter.serializeBinaryToWriter
);
}
f = message.getFragment();
if (f.length > 0) {
writer.writeString(
7,
f
);
}
};
/**
* @enum {number}
*/
proto.spine.net.Uri.Schema = {
UNDEFINED: 0,
HTTP: 1,
HTTPS: 2,
FTP: 3,
MAILTO: 4,
FILE: 5,
DATA: 6,
IRC: 7,
RTP: 8
};
/**
* 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.spine.net.Uri.Protocol.oneofGroups_ = [[1,2]];
/**
* @enum {number}
*/
proto.spine.net.Uri.Protocol.ProtocolCase = {
PROTOCOL_NOT_SET: 0,
SCHEMA: 1,
NAME: 2
};
/**
* @return {proto.spine.net.Uri.Protocol.ProtocolCase}
*/
proto.spine.net.Uri.Protocol.prototype.getProtocolCase = function() {
return /** @type {proto.spine.net.Uri.Protocol.ProtocolCase} */(jspb.Message.computeOneofCase(this, proto.spine.net.Uri.Protocol.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.spine.net.Uri.Protocol.prototype.toObject = function(opt_includeInstance) {
return proto.spine.net.Uri.Protocol.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.spine.net.Uri.Protocol} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.net.Uri.Protocol.toObject = function(includeInstance, msg) {
var f, obj = {
schema: jspb.Message.getFieldWithDefault(msg, 1, 0),
name: 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.spine.net.Uri.Protocol}
*/
proto.spine.net.Uri.Protocol.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.spine.net.Uri.Protocol;
return proto.spine.net.Uri.Protocol.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.spine.net.Uri.Protocol} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.spine.net.Uri.Protocol}
*/
proto.spine.net.Uri.Protocol.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {!proto.spine.net.Uri.Schema} */ (reader.readEnum());
msg.setSchema(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setName(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.spine.net.Uri.Protocol.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.spine.net.Uri.Protocol.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.spine.net.Uri.Protocol} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.net.Uri.Protocol.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = /** @type {!proto.spine.net.Uri.Schema} */ (jspb.Message.getField(message, 1));
if (f != null) {
writer.writeEnum(
1,
f
);
}
f = /** @type {string} */ (jspb.Message.getField(message, 2));
if (f != null) {
writer.writeString(
2,
f
);
}
};
/**
* optional Schema schema = 1;
* @return {!proto.spine.net.Uri.Schema}
*/
proto.spine.net.Uri.Protocol.prototype.getSchema = function() {
return /** @type {!proto.spine.net.Uri.Schema} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/**
* @param {!proto.spine.net.Uri.Schema} value
* @return {!proto.spine.net.Uri.Protocol} returns this
*/
proto.spine.net.Uri.Protocol.prototype.setSchema = function(value) {
return jspb.Message.setOneofField(this, 1, proto.spine.net.Uri.Protocol.oneofGroups_[0], value);
};
/**
* Clears the field making it undefined.
* @return {!proto.spine.net.Uri.Protocol} returns this
*/
proto.spine.net.Uri.Protocol.prototype.clearSchema = function() {
return jspb.Message.setOneofField(this, 1, proto.spine.net.Uri.Protocol.oneofGroups_[0], undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.net.Uri.Protocol.prototype.hasSchema = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional string name = 2;
* @return {string}
*/
proto.spine.net.Uri.Protocol.prototype.getName = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.spine.net.Uri.Protocol} returns this
*/
proto.spine.net.Uri.Protocol.prototype.setName = function(value) {
return jspb.Message.setOneofField(this, 2, proto.spine.net.Uri.Protocol.oneofGroups_[0], value);
};
/**
* Clears the field making it undefined.
* @return {!proto.spine.net.Uri.Protocol} returns this
*/
proto.spine.net.Uri.Protocol.prototype.clearName = function() {
return jspb.Message.setOneofField(this, 2, proto.spine.net.Uri.Protocol.oneofGroups_[0], undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.net.Uri.Protocol.prototype.hasName = function() {
return jspb.Message.getField(this, 2) != null;
};
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.spine.net.Uri.Authorization.prototype.toObject = function(opt_includeInstance) {
return proto.spine.net.Uri.Authorization.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.spine.net.Uri.Authorization} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.net.Uri.Authorization.toObject = function(includeInstance, msg) {
var f, obj = {
userName: jspb.Message.getFieldWithDefault(msg, 1, ""),
password: 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.spine.net.Uri.Authorization}
*/
proto.spine.net.Uri.Authorization.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.spine.net.Uri.Authorization;
return proto.spine.net.Uri.Authorization.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.spine.net.Uri.Authorization} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.spine.net.Uri.Authorization}
*/
proto.spine.net.Uri.Authorization.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.setUserName(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setPassword(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.spine.net.Uri.Authorization.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.spine.net.Uri.Authorization.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.spine.net.Uri.Authorization} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.net.Uri.Authorization.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getUserName();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getPassword();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
};
/**
* optional string user_name = 1;
* @return {string}
*/
proto.spine.net.Uri.Authorization.prototype.getUserName = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.spine.net.Uri.Authorization} returns this
*/
proto.spine.net.Uri.Authorization.prototype.setUserName = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string password = 2;
* @return {string}
*/
proto.spine.net.Uri.Authorization.prototype.getPassword = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.spine.net.Uri.Authorization} returns this
*/
proto.spine.net.Uri.Authorization.prototype.setPassword = 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.spine.net.Uri.QueryParameter.prototype.toObject = function(opt_includeInstance) {
return proto.spine.net.Uri.QueryParameter.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.spine.net.Uri.QueryParameter} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.net.Uri.QueryParameter.toObject = function(includeInstance, msg) {
var f, obj = {
key: jspb.Message.getFieldWithDefault(msg, 1, ""),
value: 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.spine.net.Uri.QueryParameter}
*/
proto.spine.net.Uri.QueryParameter.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.spine.net.Uri.QueryParameter;
return proto.spine.net.Uri.QueryParameter.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.spine.net.Uri.QueryParameter} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.spine.net.Uri.QueryParameter}
*/
proto.spine.net.Uri.QueryParameter.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.setKey(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setValue(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.spine.net.Uri.QueryParameter.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.spine.net.Uri.QueryParameter.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.spine.net.Uri.QueryParameter} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.net.Uri.QueryParameter.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getKey();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getValue();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
};
/**
* optional string key = 1;
* @return {string}
*/
proto.spine.net.Uri.QueryParameter.prototype.getKey = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.spine.net.Uri.QueryParameter} returns this
*/
proto.spine.net.Uri.QueryParameter.prototype.setKey = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string value = 2;
* @return {string}
*/
proto.spine.net.Uri.QueryParameter.prototype.getValue = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.spine.net.Uri.QueryParameter} returns this
*/
proto.spine.net.Uri.QueryParameter.prototype.setValue = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional Protocol protocol = 1;
* @return {?proto.spine.net.Uri.Protocol}
*/
proto.spine.net.Uri.prototype.getProtocol = function() {
return /** @type{?proto.spine.net.Uri.Protocol} */ (
jspb.Message.getWrapperField(this, proto.spine.net.Uri.Protocol, 1));
};
/**
* @param {?proto.spine.net.Uri.Protocol|undefined} value
* @return {!proto.spine.net.Uri} returns this
*/
proto.spine.net.Uri.prototype.setProtocol = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.spine.net.Uri} returns this
*/
proto.spine.net.Uri.prototype.clearProtocol = function() {
return this.setProtocol(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.net.Uri.prototype.hasProtocol = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional Authorization auth = 2;
* @return {?proto.spine.net.Uri.Authorization}
*/
proto.spine.net.Uri.prototype.getAuth = function() {
return /** @type{?proto.spine.net.Uri.Authorization} */ (
jspb.Message.getWrapperField(this, proto.spine.net.Uri.Authorization, 2));
};
/**
* @param {?proto.spine.net.Uri.Authorization|undefined} value
* @return {!proto.spine.net.Uri} returns this
*/
proto.spine.net.Uri.prototype.setAuth = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.spine.net.Uri} returns this
*/
proto.spine.net.Uri.prototype.clearAuth = function() {
return this.setAuth(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.net.Uri.prototype.hasAuth = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* optional string host = 3;
* @return {string}
*/
proto.spine.net.Uri.prototype.getHost = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* @param {string} value
* @return {!proto.spine.net.Uri} returns this
*/
proto.spine.net.Uri.prototype.setHost = function(value) {
return jspb.Message.setProto3StringField(this, 3, value);
};
/**
* optional string port = 4;
* @return {string}
*/
proto.spine.net.Uri.prototype.getPort = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};
/**
* @param {string} value
* @return {!proto.spine.net.Uri} returns this
*/
proto.spine.net.Uri.prototype.setPort = function(value) {
return jspb.Message.setProto3StringField(this, 4, value);
};
/**
* optional string path = 5;
* @return {string}
*/
proto.spine.net.Uri.prototype.getPath = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
};
/**
* @param {string} value
* @return {!proto.spine.net.Uri} returns this
*/
proto.spine.net.Uri.prototype.setPath = function(value) {
return jspb.Message.setProto3StringField(this, 5, value);
};
/**
* repeated QueryParameter query = 6;
* @return {!Array<!proto.spine.net.Uri.QueryParameter>}
*/
proto.spine.net.Uri.prototype.getQueryList = function() {
return /** @type{!Array<!proto.spine.net.Uri.QueryParameter>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.spine.net.Uri.QueryParameter, 6));
};
/**
* @param {!Array<!proto.spine.net.Uri.QueryParameter>} value
* @return {!proto.spine.net.Uri} returns this
*/
proto.spine.net.Uri.prototype.setQueryList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 6, value);
};
/**
* @param {!proto.spine.net.Uri.QueryParameter=} opt_value
* @param {number=} opt_index
* @return {!proto.spine.net.Uri.QueryParameter}
*/
proto.spine.net.Uri.prototype.addQuery = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.spine.net.Uri.QueryParameter, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.spine.net.Uri} returns this
*/
proto.spine.net.Uri.prototype.clearQueryList = function() {
return this.setQueryList([]);
};
/**
* optional string fragment = 7;
* @return {string}
*/
proto.spine.net.Uri.prototype.getFragment = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
};
/**
* @param {string} value
* @return {!proto.spine.net.Uri} returns this
*/
proto.spine.net.Uri.prototype.setFragment = function(value) {
return jspb.Message.setProto3StringField(this, 7, value);
};
goog.object.extend(exports, proto.spine.net);
// Generated by Spine ProtoJs Plugin
let ObjectParser = require('../../../client/parser/object-parser.js').default;
let TypeParsers = require('../../../client/parser/type-parsers.js').default;
proto.spine.net.Uri.Protocol.Parser = function() {
ObjectParser.call(this);
};
proto.spine.net.Uri.Protocol.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.net.Uri.Protocol.Parser.prototype.constructor = proto.spine.net.Uri.Protocol.Parser;
proto.spine.net.Uri.Protocol.Parser.prototype.fromObject = function(obj) {
if (obj === null) {
return null;
}
let msg = new proto.spine.net.Uri.Protocol();
if (obj.schema !== undefined) {
if (obj.schema !== null) {
let value = proto.spine.net.Uri.Schema[obj.schema];
msg.setSchema(value);
}
}
if (obj.name !== undefined) {
if (obj.name !== null) {
let value = obj.name;
msg.setName(value);
}
}
return msg;
};
proto.spine.net.Uri.Authorization.Parser = function() {
ObjectParser.call(this);
};
proto.spine.net.Uri.Authorization.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.net.Uri.Authorization.Parser.prototype.constructor = proto.spine.net.Uri.Authorization.Parser;
proto.spine.net.Uri.Authorization.Parser.prototype.fromObject = function(obj) {
if (obj === null) {
return null;
}
let msg = new proto.spine.net.Uri.Authorization();
if (obj.userName !== undefined) {
if (obj.userName !== null) {
let value = obj.userName;
msg.setUserName(value);
}
}
if (obj.password !== undefined) {
if (obj.password !== null) {
let value = obj.password;
msg.setPassword(value);
}
}
return msg;
};
proto.spine.net.Url.Parser = function() {
ObjectParser.call(this);
};
proto.spine.net.Url.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.net.Url.Parser.prototype.constructor = proto.spine.net.Url.Parser;
proto.spine.net.Url.Parser.prototype.fromObject = function(obj) {
if (obj === null) {
return null;
}
let msg = new proto.spine.net.Url();
if (obj.spec !== undefined) {
if (obj.spec !== null) {
let value = obj.spec;
msg.setSpec(value);
}
}
return msg;
};
proto.spine.net.Uri.Parser = function() {
ObjectParser.call(this);
};
proto.spine.net.Uri.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.net.Uri.Parser.prototype.constructor = proto.spine.net.Uri.Parser;
proto.spine.net.Uri.Parser.prototype.fromObject = function(obj) {
if (obj === null) {
return null;
}
let msg = new proto.spine.net.Uri();
if (obj.protocol !== undefined) {
if (obj.protocol === null) {
msg.setProtocol(null);
} else {
let value = TypeParsers.parserFor('type.spine.io/spine.net.Uri.Protocol').fromObject(obj.protocol);
msg.setProtocol(value);
}
}
if (obj.auth !== undefined) {
if (obj.auth === null) {
msg.setAuth(null);
} else {
let value = TypeParsers.parserFor('type.spine.io/spine.net.Uri.Authorization').fromObject(obj.auth);
msg.setAuth(value);
}
}
if (obj.host !== undefined) {
if (obj.host !== null) {
let value = obj.host;
msg.setHost(value);
}
}
if (obj.port !== undefined) {
if (obj.port !== null) {
let value = obj.port;
msg.setPort(value);
}
}
if (obj.path !== undefined) {
if (obj.path !== null) {
let value = obj.path;
msg.setPath(value);
}
}
if (obj.query !== undefined && obj.query !== null) {
obj.query.forEach(
(listItem, index, array) => {
if (listItem === null) {
msg.addQuery(null);
} else {
let value = TypeParsers.parserFor('type.spine.io/spine.net.Uri.QueryParameter').fromObject(listItem);
msg.addQuery(value);
}
}
);
}
if (obj.fragment !== undefined) {
if (obj.fragment !== null) {
let value = obj.fragment;
msg.setFragment(value);
}
}
return msg;
};
proto.spine.net.Uri.QueryParameter.Parser = function() {
ObjectParser.call(this);
};
proto.spine.net.Uri.QueryParameter.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.net.Uri.QueryParameter.Parser.prototype.constructor = proto.spine.net.Uri.QueryParameter.Parser;
proto.spine.net.Uri.QueryParameter.Parser.prototype.fromObject = function(obj) {
if (obj === null) {
return null;
}
let msg = new proto.spine.net.Uri.QueryParameter();
if (obj.key !== undefined) {
if (obj.key !== null) {
let value = obj.key;
msg.setKey(value);
}
}
if (obj.value !== undefined) {
if (obj.value !== null) {
let value = obj.value;
msg.setValue(value);
}
}
return msg;
};
// Generated by Spine ProtoJs Plugin
proto.spine.net.Uri.Protocol.typeUrl = function() {
return 'type.spine.io/spine.net.Uri.Protocol';
};
// Generated by Spine ProtoJs Plugin
proto.spine.net.Uri.Authorization.typeUrl = function() {
return 'type.spine.io/spine.net.Uri.Authorization';
};
// Generated by Spine ProtoJs Plugin
proto.spine.net.Url.typeUrl = function() {
return 'type.spine.io/spine.net.Url';
};
// Generated by Spine ProtoJs Plugin
proto.spine.net.Uri.typeUrl = function() {
return 'type.spine.io/spine.net.Uri';
};
// Generated by Spine ProtoJs Plugin
proto.spine.net.Uri.QueryParameter.typeUrl = function() {
return 'type.spine.io/spine.net.Uri.QueryParameter';
};
// Generated by Spine ProtoJs Plugin
proto.spine.net.Uri.Schema.typeUrl = function() {
return 'type.spine.io/spine.net.Uri.Schema';
};