//
// Autogenerated by Thrift
//
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
//
var Thrift = require('thrift').Thrift;

var ttypes = require('./fb303_types');
//HELPER FUNCTIONS AND STRUCTURES

var FacebookService_getName_args = function(args){
}
FacebookService_getName_args.prototype = {}
FacebookService_getName_args.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    var ret = input.readFieldBegin()
    var fname = ret.fname
    var ftype = ret.ftype
    var fid   = ret.fid
    if (ftype == Thrift.Type.STOP) 
      break
    switch(fid)
    {
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_getName_args.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_getName_args')
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_getName_result = function(args){
  this.success = null
if( args != null ){  if (null != args.success)
  this.success = args.success
}}
FacebookService_getName_result.prototype = {}
FacebookService_getName_result.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    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 0:      if (ftype == Thrift.Type.STRING) {
        this.success = input.readString()
      } else {
        input.skip(ftype)
      }
      break
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_getName_result.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_getName_result')
  if (null != this.success) {
    output.writeFieldBegin('success', Thrift.Type.STRING, 0)
    output.writeString(this.success)
    output.writeFieldEnd()
  }
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_getVersion_args = function(args){
}
FacebookService_getVersion_args.prototype = {}
FacebookService_getVersion_args.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    var ret = input.readFieldBegin()
    var fname = ret.fname
    var ftype = ret.ftype
    var fid   = ret.fid
    if (ftype == Thrift.Type.STOP) 
      break
    switch(fid)
    {
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_getVersion_args.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_getVersion_args')
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_getVersion_result = function(args){
  this.success = null
if( args != null ){  if (null != args.success)
  this.success = args.success
}}
FacebookService_getVersion_result.prototype = {}
FacebookService_getVersion_result.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    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 0:      if (ftype == Thrift.Type.STRING) {
        this.success = input.readString()
      } else {
        input.skip(ftype)
      }
      break
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_getVersion_result.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_getVersion_result')
  if (null != this.success) {
    output.writeFieldBegin('success', Thrift.Type.STRING, 0)
    output.writeString(this.success)
    output.writeFieldEnd()
  }
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_getStatus_args = function(args){
}
FacebookService_getStatus_args.prototype = {}
FacebookService_getStatus_args.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    var ret = input.readFieldBegin()
    var fname = ret.fname
    var ftype = ret.ftype
    var fid   = ret.fid
    if (ftype == Thrift.Type.STOP) 
      break
    switch(fid)
    {
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_getStatus_args.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_getStatus_args')
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_getStatus_result = function(args){
  this.success = null
if( args != null ){  if (null != args.success)
  this.success = args.success
}}
FacebookService_getStatus_result.prototype = {}
FacebookService_getStatus_result.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    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 0:      if (ftype == Thrift.Type.I32) {
        this.success = input.readI32()
      } else {
        input.skip(ftype)
      }
      break
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_getStatus_result.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_getStatus_result')
  if (null != this.success) {
    output.writeFieldBegin('success', Thrift.Type.I32, 0)
    output.writeI32(this.success)
    output.writeFieldEnd()
  }
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_getStatusDetails_args = function(args){
}
FacebookService_getStatusDetails_args.prototype = {}
FacebookService_getStatusDetails_args.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    var ret = input.readFieldBegin()
    var fname = ret.fname
    var ftype = ret.ftype
    var fid   = ret.fid
    if (ftype == Thrift.Type.STOP) 
      break
    switch(fid)
    {
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_getStatusDetails_args.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_getStatusDetails_args')
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_getStatusDetails_result = function(args){
  this.success = null
if( args != null ){  if (null != args.success)
  this.success = args.success
}}
FacebookService_getStatusDetails_result.prototype = {}
FacebookService_getStatusDetails_result.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    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 0:      if (ftype == Thrift.Type.STRING) {
        this.success = input.readString()
      } else {
        input.skip(ftype)
      }
      break
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_getStatusDetails_result.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_getStatusDetails_result')
  if (null != this.success) {
    output.writeFieldBegin('success', Thrift.Type.STRING, 0)
    output.writeString(this.success)
    output.writeFieldEnd()
  }
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_getCounters_args = function(args){
}
FacebookService_getCounters_args.prototype = {}
FacebookService_getCounters_args.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    var ret = input.readFieldBegin()
    var fname = ret.fname
    var ftype = ret.ftype
    var fid   = ret.fid
    if (ftype == Thrift.Type.STOP) 
      break
    switch(fid)
    {
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_getCounters_args.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_getCounters_args')
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_getCounters_result = function(args){
  this.success = null
if( args != null ){  if (null != args.success)
  this.success = args.success
}}
FacebookService_getCounters_result.prototype = {}
FacebookService_getCounters_result.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    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 0:      if (ftype == Thrift.Type.MAP) {
        {
          var _size0 = 0
          var rtmp3
          this.success = {}
          var _ktype1 = 0
          var _vtype2 = 0
          rtmp3 = input.readMapBegin()
          _ktype1= rtmp3.ktype
          _vtype2= rtmp3.vtype
          _size0= rtmp3.size
          for (var _i4 = 0; _i4 < _size0; ++_i4)
          {
            key5 = null
            val6 = null
            key5 = input.readString()
            val6 = input.readI64()
            this.success[key5] = val6
          }
          input.readMapEnd()
        }
      } else {
        input.skip(ftype)
      }
      break
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_getCounters_result.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_getCounters_result')
  if (null != this.success) {
    output.writeFieldBegin('success', Thrift.Type.MAP, 0)
    {
      output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.I64, Thrift.objectLength(this.success))
      {
        for(var kiter7 in this.success)        {
          if (this.success.hasOwnProperty(kiter7))
          {
            var viter8 = this.success[kiter7]
            output.writeString(kiter7)
            output.writeI64(viter8)
          }
        }
      }
      output.writeMapEnd()
    }
    output.writeFieldEnd()
  }
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_getCounter_args = function(args){
  this.key = null
if( args != null ){  if (null != args.key)
  this.key = args.key
}}
FacebookService_getCounter_args.prototype = {}
FacebookService_getCounter_args.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    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.key = input.readString()
      } else {
        input.skip(ftype)
      }
      break
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_getCounter_args.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_getCounter_args')
  if (null != this.key) {
    output.writeFieldBegin('key', Thrift.Type.STRING, 1)
    output.writeString(this.key)
    output.writeFieldEnd()
  }
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_getCounter_result = function(args){
  this.success = null
if( args != null ){  if (null != args.success)
  this.success = args.success
}}
FacebookService_getCounter_result.prototype = {}
FacebookService_getCounter_result.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    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 0:      if (ftype == Thrift.Type.I64) {
        this.success = input.readI64()
      } else {
        input.skip(ftype)
      }
      break
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_getCounter_result.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_getCounter_result')
  if (null != this.success) {
    output.writeFieldBegin('success', Thrift.Type.I64, 0)
    output.writeI64(this.success)
    output.writeFieldEnd()
  }
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_setOption_args = function(args){
  this.key = null
  this.value = null
if( args != null ){  if (null != args.key)
  this.key = args.key
  if (null != args.value)
  this.value = args.value
}}
FacebookService_setOption_args.prototype = {}
FacebookService_setOption_args.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    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.key = input.readString()
      } else {
        input.skip(ftype)
      }
      break
      case 2:      if (ftype == Thrift.Type.STRING) {
        this.value = input.readString()
      } else {
        input.skip(ftype)
      }
      break
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_setOption_args.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_setOption_args')
  if (null != this.key) {
    output.writeFieldBegin('key', Thrift.Type.STRING, 1)
    output.writeString(this.key)
    output.writeFieldEnd()
  }
  if (null != this.value) {
    output.writeFieldBegin('value', Thrift.Type.STRING, 2)
    output.writeString(this.value)
    output.writeFieldEnd()
  }
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_setOption_result = function(args){
}
FacebookService_setOption_result.prototype = {}
FacebookService_setOption_result.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    var ret = input.readFieldBegin()
    var fname = ret.fname
    var ftype = ret.ftype
    var fid   = ret.fid
    if (ftype == Thrift.Type.STOP) 
      break
    switch(fid)
    {
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_setOption_result.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_setOption_result')
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_getOption_args = function(args){
  this.key = null
if( args != null ){  if (null != args.key)
  this.key = args.key
}}
FacebookService_getOption_args.prototype = {}
FacebookService_getOption_args.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    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.key = input.readString()
      } else {
        input.skip(ftype)
      }
      break
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_getOption_args.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_getOption_args')
  if (null != this.key) {
    output.writeFieldBegin('key', Thrift.Type.STRING, 1)
    output.writeString(this.key)
    output.writeFieldEnd()
  }
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_getOption_result = function(args){
  this.success = null
if( args != null ){  if (null != args.success)
  this.success = args.success
}}
FacebookService_getOption_result.prototype = {}
FacebookService_getOption_result.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    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 0:      if (ftype == Thrift.Type.STRING) {
        this.success = input.readString()
      } else {
        input.skip(ftype)
      }
      break
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_getOption_result.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_getOption_result')
  if (null != this.success) {
    output.writeFieldBegin('success', Thrift.Type.STRING, 0)
    output.writeString(this.success)
    output.writeFieldEnd()
  }
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_getOptions_args = function(args){
}
FacebookService_getOptions_args.prototype = {}
FacebookService_getOptions_args.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    var ret = input.readFieldBegin()
    var fname = ret.fname
    var ftype = ret.ftype
    var fid   = ret.fid
    if (ftype == Thrift.Type.STOP) 
      break
    switch(fid)
    {
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_getOptions_args.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_getOptions_args')
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_getOptions_result = function(args){
  this.success = null
if( args != null ){  if (null != args.success)
  this.success = args.success
}}
FacebookService_getOptions_result.prototype = {}
FacebookService_getOptions_result.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    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 0:      if (ftype == Thrift.Type.MAP) {
        {
          var _size9 = 0
          var rtmp3
          this.success = {}
          var _ktype10 = 0
          var _vtype11 = 0
          rtmp3 = input.readMapBegin()
          _ktype10= rtmp3.ktype
          _vtype11= rtmp3.vtype
          _size9= rtmp3.size
          for (var _i13 = 0; _i13 < _size9; ++_i13)
          {
            key14 = null
            val15 = null
            key14 = input.readString()
            val15 = input.readString()
            this.success[key14] = val15
          }
          input.readMapEnd()
        }
      } else {
        input.skip(ftype)
      }
      break
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_getOptions_result.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_getOptions_result')
  if (null != this.success) {
    output.writeFieldBegin('success', Thrift.Type.MAP, 0)
    {
      output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.success))
      {
        for(var kiter16 in this.success)        {
          if (this.success.hasOwnProperty(kiter16))
          {
            var viter17 = this.success[kiter16]
            output.writeString(kiter16)
            output.writeString(viter17)
          }
        }
      }
      output.writeMapEnd()
    }
    output.writeFieldEnd()
  }
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_getCpuProfile_args = function(args){
  this.profileDurationInSec = null
if( args != null ){  if (null != args.profileDurationInSec)
  this.profileDurationInSec = args.profileDurationInSec
}}
FacebookService_getCpuProfile_args.prototype = {}
FacebookService_getCpuProfile_args.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    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.profileDurationInSec = input.readI32()
      } else {
        input.skip(ftype)
      }
      break
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_getCpuProfile_args.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_getCpuProfile_args')
  if (null != this.profileDurationInSec) {
    output.writeFieldBegin('profileDurationInSec', Thrift.Type.I32, 1)
    output.writeI32(this.profileDurationInSec)
    output.writeFieldEnd()
  }
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_getCpuProfile_result = function(args){
  this.success = null
if( args != null ){  if (null != args.success)
  this.success = args.success
}}
FacebookService_getCpuProfile_result.prototype = {}
FacebookService_getCpuProfile_result.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    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 0:      if (ftype == Thrift.Type.STRING) {
        this.success = input.readString()
      } else {
        input.skip(ftype)
      }
      break
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_getCpuProfile_result.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_getCpuProfile_result')
  if (null != this.success) {
    output.writeFieldBegin('success', Thrift.Type.STRING, 0)
    output.writeString(this.success)
    output.writeFieldEnd()
  }
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_aliveSince_args = function(args){
}
FacebookService_aliveSince_args.prototype = {}
FacebookService_aliveSince_args.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    var ret = input.readFieldBegin()
    var fname = ret.fname
    var ftype = ret.ftype
    var fid   = ret.fid
    if (ftype == Thrift.Type.STOP) 
      break
    switch(fid)
    {
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_aliveSince_args.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_aliveSince_args')
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_aliveSince_result = function(args){
  this.success = null
if( args != null ){  if (null != args.success)
  this.success = args.success
}}
FacebookService_aliveSince_result.prototype = {}
FacebookService_aliveSince_result.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    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 0:      if (ftype == Thrift.Type.I64) {
        this.success = input.readI64()
      } else {
        input.skip(ftype)
      }
      break
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_aliveSince_result.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_aliveSince_result')
  if (null != this.success) {
    output.writeFieldBegin('success', Thrift.Type.I64, 0)
    output.writeI64(this.success)
    output.writeFieldEnd()
  }
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_reinitialize_args = function(args){
}
FacebookService_reinitialize_args.prototype = {}
FacebookService_reinitialize_args.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    var ret = input.readFieldBegin()
    var fname = ret.fname
    var ftype = ret.ftype
    var fid   = ret.fid
    if (ftype == Thrift.Type.STOP) 
      break
    switch(fid)
    {
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_reinitialize_args.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_reinitialize_args')
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_reinitialize_result = function(args){
}
FacebookService_reinitialize_result.prototype = {}
FacebookService_reinitialize_result.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    var ret = input.readFieldBegin()
    var fname = ret.fname
    var ftype = ret.ftype
    var fid   = ret.fid
    if (ftype == Thrift.Type.STOP) 
      break
    switch(fid)
    {
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_reinitialize_result.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_reinitialize_result')
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_shutdown_args = function(args){
}
FacebookService_shutdown_args.prototype = {}
FacebookService_shutdown_args.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    var ret = input.readFieldBegin()
    var fname = ret.fname
    var ftype = ret.ftype
    var fid   = ret.fid
    if (ftype == Thrift.Type.STOP) 
      break
    switch(fid)
    {
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_shutdown_args.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_shutdown_args')
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookService_shutdown_result = function(args){
}
FacebookService_shutdown_result.prototype = {}
FacebookService_shutdown_result.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    var ret = input.readFieldBegin()
    var fname = ret.fname
    var ftype = ret.ftype
    var fid   = ret.fid
    if (ftype == Thrift.Type.STOP) 
      break
    switch(fid)
    {
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

FacebookService_shutdown_result.prototype.write = function(output){ 
  output.writeStructBegin('FacebookService_shutdown_result')
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var FacebookServiceClient = exports.Client = function(output, pClass) {
    this.output = output;
    this.pClass = pClass;
    this.seqid = 0;
    this._reqs = {}
}
FacebookServiceClient.prototype = {}
FacebookServiceClient.prototype.getName = function(callback){
  this.seqid += 1;
  this._reqs[this.seqid] = callback;
    this.send_getName()
}

FacebookServiceClient.prototype.send_getName = function(){
  var output = new this.pClass(this.output);
  output.writeMessageBegin('getName', Thrift.MessageType.CALL, this.seqid)
  var args = new FacebookService_getName_args()
  args.write(output)
  output.writeMessageEnd()
  return this.output.flush()
}

FacebookServiceClient.prototype.recv_getName = function(input,mtype,rseqid){
  var callback = this._reqs[rseqid] || function() {};
  delete this._reqs[rseqid];
  if (mtype == Thrift.MessageType.EXCEPTION) {
    var x = new Thrift.TApplicationException()
    x.read(input)
    input.readMessageEnd()
    return callback(x);
  }
  var result = new FacebookService_getName_result()
  result.read(input)
  input.readMessageEnd()

  if (null != result.success ) {
    return callback(null, result.success);
  }
  return callback("getName failed: unknown result");
}
FacebookServiceClient.prototype.getVersion = function(callback){
  this.seqid += 1;
  this._reqs[this.seqid] = callback;
    this.send_getVersion()
}

FacebookServiceClient.prototype.send_getVersion = function(){
  var output = new this.pClass(this.output);
  output.writeMessageBegin('getVersion', Thrift.MessageType.CALL, this.seqid)
  var args = new FacebookService_getVersion_args()
  args.write(output)
  output.writeMessageEnd()
  return this.output.flush()
}

FacebookServiceClient.prototype.recv_getVersion = function(input,mtype,rseqid){
  var callback = this._reqs[rseqid] || function() {};
  delete this._reqs[rseqid];
  if (mtype == Thrift.MessageType.EXCEPTION) {
    var x = new Thrift.TApplicationException()
    x.read(input)
    input.readMessageEnd()
    return callback(x);
  }
  var result = new FacebookService_getVersion_result()
  result.read(input)
  input.readMessageEnd()

  if (null != result.success ) {
    return callback(null, result.success);
  }
  return callback("getVersion failed: unknown result");
}
FacebookServiceClient.prototype.getStatus = function(callback){
  this.seqid += 1;
  this._reqs[this.seqid] = callback;
    this.send_getStatus()
}

FacebookServiceClient.prototype.send_getStatus = function(){
  var output = new this.pClass(this.output);
  output.writeMessageBegin('getStatus', Thrift.MessageType.CALL, this.seqid)
  var args = new FacebookService_getStatus_args()
  args.write(output)
  output.writeMessageEnd()
  return this.output.flush()
}

FacebookServiceClient.prototype.recv_getStatus = function(input,mtype,rseqid){
  var callback = this._reqs[rseqid] || function() {};
  delete this._reqs[rseqid];
  if (mtype == Thrift.MessageType.EXCEPTION) {
    var x = new Thrift.TApplicationException()
    x.read(input)
    input.readMessageEnd()
    return callback(x);
  }
  var result = new FacebookService_getStatus_result()
  result.read(input)
  input.readMessageEnd()

  if (null != result.success ) {
    return callback(null, result.success);
  }
  return callback("getStatus failed: unknown result");
}
FacebookServiceClient.prototype.getStatusDetails = function(callback){
  this.seqid += 1;
  this._reqs[this.seqid] = callback;
    this.send_getStatusDetails()
}

FacebookServiceClient.prototype.send_getStatusDetails = function(){
  var output = new this.pClass(this.output);
  output.writeMessageBegin('getStatusDetails', Thrift.MessageType.CALL, this.seqid)
  var args = new FacebookService_getStatusDetails_args()
  args.write(output)
  output.writeMessageEnd()
  return this.output.flush()
}

FacebookServiceClient.prototype.recv_getStatusDetails = function(input,mtype,rseqid){
  var callback = this._reqs[rseqid] || function() {};
  delete this._reqs[rseqid];
  if (mtype == Thrift.MessageType.EXCEPTION) {
    var x = new Thrift.TApplicationException()
    x.read(input)
    input.readMessageEnd()
    return callback(x);
  }
  var result = new FacebookService_getStatusDetails_result()
  result.read(input)
  input.readMessageEnd()

  if (null != result.success ) {
    return callback(null, result.success);
  }
  return callback("getStatusDetails failed: unknown result");
}
FacebookServiceClient.prototype.getCounters = function(callback){
  this.seqid += 1;
  this._reqs[this.seqid] = callback;
    this.send_getCounters()
}

FacebookServiceClient.prototype.send_getCounters = function(){
  var output = new this.pClass(this.output);
  output.writeMessageBegin('getCounters', Thrift.MessageType.CALL, this.seqid)
  var args = new FacebookService_getCounters_args()
  args.write(output)
  output.writeMessageEnd()
  return this.output.flush()
}

FacebookServiceClient.prototype.recv_getCounters = function(input,mtype,rseqid){
  var callback = this._reqs[rseqid] || function() {};
  delete this._reqs[rseqid];
  if (mtype == Thrift.MessageType.EXCEPTION) {
    var x = new Thrift.TApplicationException()
    x.read(input)
    input.readMessageEnd()
    return callback(x);
  }
  var result = new FacebookService_getCounters_result()
  result.read(input)
  input.readMessageEnd()

  if (null != result.success ) {
    return callback(null, result.success);
  }
  return callback("getCounters failed: unknown result");
}
FacebookServiceClient.prototype.getCounter = function(key,callback){
  this.seqid += 1;
  this._reqs[this.seqid] = callback;
    this.send_getCounter(key)
}

FacebookServiceClient.prototype.send_getCounter = function(key){
  var output = new this.pClass(this.output);
  output.writeMessageBegin('getCounter', Thrift.MessageType.CALL, this.seqid)
  var args = new FacebookService_getCounter_args()
  args.key = key
  args.write(output)
  output.writeMessageEnd()
  return this.output.flush()
}

FacebookServiceClient.prototype.recv_getCounter = function(input,mtype,rseqid){
  var callback = this._reqs[rseqid] || function() {};
  delete this._reqs[rseqid];
  if (mtype == Thrift.MessageType.EXCEPTION) {
    var x = new Thrift.TApplicationException()
    x.read(input)
    input.readMessageEnd()
    return callback(x);
  }
  var result = new FacebookService_getCounter_result()
  result.read(input)
  input.readMessageEnd()

  if (null != result.success ) {
    return callback(null, result.success);
  }
  return callback("getCounter failed: unknown result");
}
FacebookServiceClient.prototype.setOption = function(key,value,callback){
  this.seqid += 1;
  this._reqs[this.seqid] = callback;
    this.send_setOption(key, value)
}

FacebookServiceClient.prototype.send_setOption = function(key,value){
  var output = new this.pClass(this.output);
  output.writeMessageBegin('setOption', Thrift.MessageType.CALL, this.seqid)
  var args = new FacebookService_setOption_args()
  args.key = key
  args.value = value
  args.write(output)
  output.writeMessageEnd()
  return this.output.flush()
}

FacebookServiceClient.prototype.recv_setOption = function(input,mtype,rseqid){
  var callback = this._reqs[rseqid] || function() {};
  delete this._reqs[rseqid];
  if (mtype == Thrift.MessageType.EXCEPTION) {
    var x = new Thrift.TApplicationException()
    x.read(input)
    input.readMessageEnd()
    return callback(x);
  }
  var result = new FacebookService_setOption_result()
  result.read(input)
  input.readMessageEnd()

  callback(null)
}
FacebookServiceClient.prototype.getOption = function(key,callback){
  this.seqid += 1;
  this._reqs[this.seqid] = callback;
    this.send_getOption(key)
}

FacebookServiceClient.prototype.send_getOption = function(key){
  var output = new this.pClass(this.output);
  output.writeMessageBegin('getOption', Thrift.MessageType.CALL, this.seqid)
  var args = new FacebookService_getOption_args()
  args.key = key
  args.write(output)
  output.writeMessageEnd()
  return this.output.flush()
}

FacebookServiceClient.prototype.recv_getOption = function(input,mtype,rseqid){
  var callback = this._reqs[rseqid] || function() {};
  delete this._reqs[rseqid];
  if (mtype == Thrift.MessageType.EXCEPTION) {
    var x = new Thrift.TApplicationException()
    x.read(input)
    input.readMessageEnd()
    return callback(x);
  }
  var result = new FacebookService_getOption_result()
  result.read(input)
  input.readMessageEnd()

  if (null != result.success ) {
    return callback(null, result.success);
  }
  return callback("getOption failed: unknown result");
}
FacebookServiceClient.prototype.getOptions = function(callback){
  this.seqid += 1;
  this._reqs[this.seqid] = callback;
    this.send_getOptions()
}

FacebookServiceClient.prototype.send_getOptions = function(){
  var output = new this.pClass(this.output);
  output.writeMessageBegin('getOptions', Thrift.MessageType.CALL, this.seqid)
  var args = new FacebookService_getOptions_args()
  args.write(output)
  output.writeMessageEnd()
  return this.output.flush()
}

FacebookServiceClient.prototype.recv_getOptions = function(input,mtype,rseqid){
  var callback = this._reqs[rseqid] || function() {};
  delete this._reqs[rseqid];
  if (mtype == Thrift.MessageType.EXCEPTION) {
    var x = new Thrift.TApplicationException()
    x.read(input)
    input.readMessageEnd()
    return callback(x);
  }
  var result = new FacebookService_getOptions_result()
  result.read(input)
  input.readMessageEnd()

  if (null != result.success ) {
    return callback(null, result.success);
  }
  return callback("getOptions failed: unknown result");
}
FacebookServiceClient.prototype.getCpuProfile = function(profileDurationInSec,callback){
  this.seqid += 1;
  this._reqs[this.seqid] = callback;
    this.send_getCpuProfile(profileDurationInSec)
}

FacebookServiceClient.prototype.send_getCpuProfile = function(profileDurationInSec){
  var output = new this.pClass(this.output);
  output.writeMessageBegin('getCpuProfile', Thrift.MessageType.CALL, this.seqid)
  var args = new FacebookService_getCpuProfile_args()
  args.profileDurationInSec = profileDurationInSec
  args.write(output)
  output.writeMessageEnd()
  return this.output.flush()
}

FacebookServiceClient.prototype.recv_getCpuProfile = function(input,mtype,rseqid){
  var callback = this._reqs[rseqid] || function() {};
  delete this._reqs[rseqid];
  if (mtype == Thrift.MessageType.EXCEPTION) {
    var x = new Thrift.TApplicationException()
    x.read(input)
    input.readMessageEnd()
    return callback(x);
  }
  var result = new FacebookService_getCpuProfile_result()
  result.read(input)
  input.readMessageEnd()

  if (null != result.success ) {
    return callback(null, result.success);
  }
  return callback("getCpuProfile failed: unknown result");
}
FacebookServiceClient.prototype.aliveSince = function(callback){
  this.seqid += 1;
  this._reqs[this.seqid] = callback;
    this.send_aliveSince()
}

FacebookServiceClient.prototype.send_aliveSince = function(){
  var output = new this.pClass(this.output);
  output.writeMessageBegin('aliveSince', Thrift.MessageType.CALL, this.seqid)
  var args = new FacebookService_aliveSince_args()
  args.write(output)
  output.writeMessageEnd()
  return this.output.flush()
}

FacebookServiceClient.prototype.recv_aliveSince = function(input,mtype,rseqid){
  var callback = this._reqs[rseqid] || function() {};
  delete this._reqs[rseqid];
  if (mtype == Thrift.MessageType.EXCEPTION) {
    var x = new Thrift.TApplicationException()
    x.read(input)
    input.readMessageEnd()
    return callback(x);
  }
  var result = new FacebookService_aliveSince_result()
  result.read(input)
  input.readMessageEnd()

  if (null != result.success ) {
    return callback(null, result.success);
  }
  return callback("aliveSince failed: unknown result");
}
FacebookServiceClient.prototype.reinitialize = function(callback){
  this.seqid += 1;
  this._reqs[this.seqid] = callback;
    this.send_reinitialize()
}

FacebookServiceClient.prototype.send_reinitialize = function(){
  var output = new this.pClass(this.output);
  output.writeMessageBegin('reinitialize', Thrift.MessageType.CALL, this.seqid)
  var args = new FacebookService_reinitialize_args()
  args.write(output)
  output.writeMessageEnd()
  return this.output.flush()
}
FacebookServiceClient.prototype.shutdown = function(callback){
  this.seqid += 1;
  this._reqs[this.seqid] = callback;
    this.send_shutdown()
}

FacebookServiceClient.prototype.send_shutdown = function(){
  var output = new this.pClass(this.output);
  output.writeMessageBegin('shutdown', Thrift.MessageType.CALL, this.seqid)
  var args = new FacebookService_shutdown_args()
  args.write(output)
  output.writeMessageEnd()
  return this.output.flush()
}
var FacebookServiceProcessor = exports.Processor = function(handler) {
  this._handler = handler
}
FacebookServiceProcessor.prototype.process = function(input, output) {
  var r = input.readMessageBegin()
  if (this['process_' + r.fname]) {
    return this['process_' + r.fname].call(this, r.rseqid, input, output)
  } else {
    input.skip(Thrift.Type.STRUCT)
    input.readMessageEnd()
    var x = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN_METHOD, 'Unknown function ' + r.fname)
    output.writeMessageBegin(r.fname, Thrift.MessageType.Exception, r.rseqid)
    x.write(output)
    output.writeMessageEnd()
    output.flush()
  }
}

FacebookServiceProcessor.prototype.process_getName = function(seqid, input, output) {
  var args = new FacebookService_getName_args()
  args.read(input)
  input.readMessageEnd()
  var result = new FacebookService_getName_result()
  this._handler.getName(function(success) {
    result.success = success
    output.writeMessageBegin("getName", Thrift.MessageType.REPLY, seqid)
    result.write(output)
    output.writeMessageEnd()
    output.flush()
  })
}

FacebookServiceProcessor.prototype.process_getVersion = function(seqid, input, output) {
  var args = new FacebookService_getVersion_args()
  args.read(input)
  input.readMessageEnd()
  var result = new FacebookService_getVersion_result()
  this._handler.getVersion(function(success) {
    result.success = success
    output.writeMessageBegin("getVersion", Thrift.MessageType.REPLY, seqid)
    result.write(output)
    output.writeMessageEnd()
    output.flush()
  })
}

FacebookServiceProcessor.prototype.process_getStatus = function(seqid, input, output) {
  var args = new FacebookService_getStatus_args()
  args.read(input)
  input.readMessageEnd()
  var result = new FacebookService_getStatus_result()
  this._handler.getStatus(function(success) {
    result.success = success
    output.writeMessageBegin("getStatus", Thrift.MessageType.REPLY, seqid)
    result.write(output)
    output.writeMessageEnd()
    output.flush()
  })
}

FacebookServiceProcessor.prototype.process_getStatusDetails = function(seqid, input, output) {
  var args = new FacebookService_getStatusDetails_args()
  args.read(input)
  input.readMessageEnd()
  var result = new FacebookService_getStatusDetails_result()
  this._handler.getStatusDetails(function(success) {
    result.success = success
    output.writeMessageBegin("getStatusDetails", Thrift.MessageType.REPLY, seqid)
    result.write(output)
    output.writeMessageEnd()
    output.flush()
  })
}

FacebookServiceProcessor.prototype.process_getCounters = function(seqid, input, output) {
  var args = new FacebookService_getCounters_args()
  args.read(input)
  input.readMessageEnd()
  var result = new FacebookService_getCounters_result()
  this._handler.getCounters(function(success) {
    result.success = success
    output.writeMessageBegin("getCounters", Thrift.MessageType.REPLY, seqid)
    result.write(output)
    output.writeMessageEnd()
    output.flush()
  })
}

FacebookServiceProcessor.prototype.process_getCounter = function(seqid, input, output) {
  var args = new FacebookService_getCounter_args()
  args.read(input)
  input.readMessageEnd()
  var result = new FacebookService_getCounter_result()
  this._handler.getCounter(args.key, function(success) {
    result.success = success
    output.writeMessageBegin("getCounter", Thrift.MessageType.REPLY, seqid)
    result.write(output)
    output.writeMessageEnd()
    output.flush()
  })
}

FacebookServiceProcessor.prototype.process_setOption = function(seqid, input, output) {
  var args = new FacebookService_setOption_args()
  args.read(input)
  input.readMessageEnd()
  var result = new FacebookService_setOption_result()
  this._handler.setOption(args.key, args.value, function(success) {
    result.success = success
    output.writeMessageBegin("setOption", Thrift.MessageType.REPLY, seqid)
    result.write(output)
    output.writeMessageEnd()
    output.flush()
  })
}

FacebookServiceProcessor.prototype.process_getOption = function(seqid, input, output) {
  var args = new FacebookService_getOption_args()
  args.read(input)
  input.readMessageEnd()
  var result = new FacebookService_getOption_result()
  this._handler.getOption(args.key, function(success) {
    result.success = success
    output.writeMessageBegin("getOption", Thrift.MessageType.REPLY, seqid)
    result.write(output)
    output.writeMessageEnd()
    output.flush()
  })
}

FacebookServiceProcessor.prototype.process_getOptions = function(seqid, input, output) {
  var args = new FacebookService_getOptions_args()
  args.read(input)
  input.readMessageEnd()
  var result = new FacebookService_getOptions_result()
  this._handler.getOptions(function(success) {
    result.success = success
    output.writeMessageBegin("getOptions", Thrift.MessageType.REPLY, seqid)
    result.write(output)
    output.writeMessageEnd()
    output.flush()
  })
}

FacebookServiceProcessor.prototype.process_getCpuProfile = function(seqid, input, output) {
  var args = new FacebookService_getCpuProfile_args()
  args.read(input)
  input.readMessageEnd()
  var result = new FacebookService_getCpuProfile_result()
  this._handler.getCpuProfile(args.profileDurationInSec, function(success) {
    result.success = success
    output.writeMessageBegin("getCpuProfile", Thrift.MessageType.REPLY, seqid)
    result.write(output)
    output.writeMessageEnd()
    output.flush()
  })
}

FacebookServiceProcessor.prototype.process_aliveSince = function(seqid, input, output) {
  var args = new FacebookService_aliveSince_args()
  args.read(input)
  input.readMessageEnd()
  var result = new FacebookService_aliveSince_result()
  this._handler.aliveSince(function(success) {
    result.success = success
    output.writeMessageBegin("aliveSince", Thrift.MessageType.REPLY, seqid)
    result.write(output)
    output.writeMessageEnd()
    output.flush()
  })
}

FacebookServiceProcessor.prototype.process_reinitialize = function(seqid, input, output) {
  var args = new FacebookService_reinitialize_args()
  args.read(input)
  input.readMessageEnd()
  this._handler.reinitialize()
}

FacebookServiceProcessor.prototype.process_shutdown = function(seqid, input, output) {
  var args = new FacebookService_shutdown_args()
  args.read(input)
  input.readMessageEnd()
  this._handler.shutdown()
}

