//
// Autogenerated by Thrift
//
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
//
var Thrift = require('thrift').Thrift;
var ttypes = module.exports = {};
var UserProfile = module.exports.UserProfile = function(args){
  this.uid = null
  this.name = null
  this.blurb = null
if( args != null ){  if (null != args.uid)
  this.uid = args.uid
  if (null != args.name)
  this.name = args.name
  if (null != args.blurb)
  this.blurb = args.blurb
}}
UserProfile.prototype = {}
UserProfile.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.uid = input.readI32()
      } else {
        input.skip(ftype)
      }
      break
      case 2:      if (ftype == Thrift.Type.STRING) {
        this.name = input.readString()
      } else {
        input.skip(ftype)
      }
      break
      case 3:      if (ftype == Thrift.Type.STRING) {
        this.blurb = input.readString()
      } else {
        input.skip(ftype)
      }
      break
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

UserProfile.prototype.write = function(output){ 
  output.writeStructBegin('UserProfile')
  if (null != this.uid) {
    output.writeFieldBegin('uid', Thrift.Type.I32, 1)
    output.writeI32(this.uid)
    output.writeFieldEnd()
  }
  if (null != this.name) {
    output.writeFieldBegin('name', Thrift.Type.STRING, 2)
    output.writeString(this.name)
    output.writeFieldEnd()
  }
  if (null != this.blurb) {
    output.writeFieldBegin('blurb', Thrift.Type.STRING, 3)
    output.writeString(this.blurb)
    output.writeFieldEnd()
  }
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

