osquery
Version:
facebook osquery client
480 lines (467 loc) • 12.3 kB
JavaScript
//
// Autogenerated by Thrift Compiler (0.9.2)
//
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
//
var thrift = require('thrift');
var Thrift = thrift.Thrift;
var Q = thrift.Q;
var ttypes = module.exports = {};
ttypes.ExtensionCode = {
'EXT_SUCCESS' : 0,
'EXT_FAILED' : 1,
'EXT_FATAL' : 2
};
InternalOptionInfo = module.exports.InternalOptionInfo = function(args) {
this.value = null;
this.default_value = null;
this.type = null;
if (args) {
if (args.value !== undefined) {
this.value = args.value;
}
if (args.default_value !== undefined) {
this.default_value = args.default_value;
}
if (args.type !== undefined) {
this.type = args.type;
}
}
};
InternalOptionInfo.prototype = {};
InternalOptionInfo.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.value = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.default_value = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.type = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
InternalOptionInfo.prototype.write = function(output) {
output.writeStructBegin('InternalOptionInfo');
if (this.value !== null && this.value !== undefined) {
output.writeFieldBegin('value', Thrift.Type.STRING, 1);
output.writeString(this.value);
output.writeFieldEnd();
}
if (this.default_value !== null && this.default_value !== undefined) {
output.writeFieldBegin('default_value', Thrift.Type.STRING, 2);
output.writeString(this.default_value);
output.writeFieldEnd();
}
if (this.type !== null && this.type !== undefined) {
output.writeFieldBegin('type', Thrift.Type.STRING, 3);
output.writeString(this.type);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
InternalExtensionInfo = module.exports.InternalExtensionInfo = function(args) {
this.name = null;
this.version = null;
this.sdk_version = null;
this.min_sdk_version = null;
if (args) {
if (args.name !== undefined) {
this.name = args.name;
}
if (args.version !== undefined) {
this.version = args.version;
}
if (args.sdk_version !== undefined) {
this.sdk_version = args.sdk_version;
}
if (args.min_sdk_version !== undefined) {
this.min_sdk_version = args.min_sdk_version;
}
}
};
InternalExtensionInfo.prototype = {};
InternalExtensionInfo.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.name = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.version = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRING) {
this.sdk_version = input.readString();
} else {
input.skip(ftype);
}
break;
case 4:
if (ftype == Thrift.Type.STRING) {
this.min_sdk_version = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
InternalExtensionInfo.prototype.write = function(output) {
output.writeStructBegin('InternalExtensionInfo');
if (this.name !== null && this.name !== undefined) {
output.writeFieldBegin('name', Thrift.Type.STRING, 1);
output.writeString(this.name);
output.writeFieldEnd();
}
if (this.version !== null && this.version !== undefined) {
output.writeFieldBegin('version', Thrift.Type.STRING, 2);
output.writeString(this.version);
output.writeFieldEnd();
}
if (this.sdk_version !== null && this.sdk_version !== undefined) {
output.writeFieldBegin('sdk_version', Thrift.Type.STRING, 3);
output.writeString(this.sdk_version);
output.writeFieldEnd();
}
if (this.min_sdk_version !== null && this.min_sdk_version !== undefined) {
output.writeFieldBegin('min_sdk_version', Thrift.Type.STRING, 4);
output.writeString(this.min_sdk_version);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
ExtensionStatus = module.exports.ExtensionStatus = function(args) {
this.code = null;
this.message = null;
this.uuid = null;
if (args) {
if (args.code !== undefined) {
this.code = args.code;
}
if (args.message !== undefined) {
this.message = args.message;
}
if (args.uuid !== undefined) {
this.uuid = args.uuid;
}
}
};
ExtensionStatus.prototype = {};
ExtensionStatus.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.I32) {
this.code = input.readI32();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.message = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.I64) {
this.uuid = input.readI64();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ExtensionStatus.prototype.write = function(output) {
output.writeStructBegin('ExtensionStatus');
if (this.code !== null && this.code !== undefined) {
output.writeFieldBegin('code', Thrift.Type.I32, 1);
output.writeI32(this.code);
output.writeFieldEnd();
}
if (this.message !== null && this.message !== undefined) {
output.writeFieldBegin('message', Thrift.Type.STRING, 2);
output.writeString(this.message);
output.writeFieldEnd();
}
if (this.uuid !== null && this.uuid !== undefined) {
output.writeFieldBegin('uuid', Thrift.Type.I64, 3);
output.writeI64(this.uuid);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
ExtensionResponse = module.exports.ExtensionResponse = function(args) {
this.status = null;
this.response = null;
if (args) {
if (args.status !== undefined) {
this.status = args.status;
}
if (args.response !== undefined) {
this.response = args.response;
}
}
};
ExtensionResponse.prototype = {};
ExtensionResponse.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRUCT) {
this.status = new ttypes.ExtensionStatus();
this.status.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.LIST) {
var _size0 = 0;
var _rtmp34;
this.response = [];
var _etype3 = 0;
_rtmp34 = input.readListBegin();
_etype3 = _rtmp34.etype;
_size0 = _rtmp34.size;
for (var _i5 = 0; _i5 < _size0; ++_i5)
{
var elem6 = null;
var _size7 = 0;
var _rtmp311;
elem6 = {};
var _ktype8 = 0;
var _vtype9 = 0;
_rtmp311 = input.readMapBegin();
_ktype8 = _rtmp311.ktype;
_vtype9 = _rtmp311.vtype;
_size7 = _rtmp311.size;
for (var _i12 = 0; _i12 < _size7; ++_i12)
{
var key13 = null;
var val14 = null;
key13 = input.readString();
val14 = input.readString();
elem6[key13] = val14;
}
input.readMapEnd();
this.response.push(elem6);
}
input.readListEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ExtensionResponse.prototype.write = function(output) {
output.writeStructBegin('ExtensionResponse');
if (this.status !== null && this.status !== undefined) {
output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
this.status.write(output);
output.writeFieldEnd();
}
if (this.response !== null && this.response !== undefined) {
output.writeFieldBegin('response', Thrift.Type.LIST, 2);
output.writeListBegin(Thrift.Type.MAP, this.response.length);
for (var iter15 in this.response)
{
if (this.response.hasOwnProperty(iter15))
{
iter15 = this.response[iter15];
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(iter15));
for (var kiter16 in iter15)
{
if (iter15.hasOwnProperty(kiter16))
{
var viter17 = iter15[kiter16];
output.writeString(kiter16);
output.writeString(viter17);
}
}
output.writeMapEnd();
}
}
output.writeListEnd();
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
ExtensionException = module.exports.ExtensionException = function(args) {
Thrift.TException.call(this, "ExtensionException")
this.name = "ExtensionException"
this.code = null;
this.message = null;
this.uuid = null;
if (args) {
if (args.code !== undefined) {
this.code = args.code;
}
if (args.message !== undefined) {
this.message = args.message;
}
if (args.uuid !== undefined) {
this.uuid = args.uuid;
}
}
};
Thrift.inherits(ExtensionException, Thrift.TException);
ExtensionException.prototype.name = 'ExtensionException';
ExtensionException.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.I32) {
this.code = input.readI32();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.message = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.I64) {
this.uuid = input.readI64();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
ExtensionException.prototype.write = function(output) {
output.writeStructBegin('ExtensionException');
if (this.code !== null && this.code !== undefined) {
output.writeFieldBegin('code', Thrift.Type.I32, 1);
output.writeI32(this.code);
output.writeFieldEnd();
}
if (this.message !== null && this.message !== undefined) {
output.writeFieldBegin('message', Thrift.Type.STRING, 2);
output.writeString(this.message);
output.writeFieldEnd();
}
if (this.uuid !== null && this.uuid !== undefined) {
output.writeFieldBegin('uuid', Thrift.Type.I64, 3);
output.writeI64(this.uuid);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};