// Autogenerated by Thrift Compiler (0.12.0)
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING

package fb303

import (
	"bytes"
	"context"
	"reflect"
	"database/sql/driver"
	"errors"
	"fmt"
	"github.com/apache/thrift/lib/go/thrift"
)

// (needed to ensure safety because of naive import list construction.)
var _ = thrift.ZERO
var _ = fmt.Printf
var _ = context.Background
var _ = reflect.DeepEqual
var _ = bytes.Equal

//Common status reporting mechanism across all services
type FbStatus int64
const (
  FbStatus_DEAD FbStatus = 0
  FbStatus_STARTING FbStatus = 1
  FbStatus_ALIVE FbStatus = 2
  FbStatus_STOPPING FbStatus = 3
  FbStatus_STOPPED FbStatus = 4
  FbStatus_WARNING FbStatus = 5
)

func (p FbStatus) String() string {
  switch p {
  case FbStatus_DEAD: return "DEAD"
  case FbStatus_STARTING: return "STARTING"
  case FbStatus_ALIVE: return "ALIVE"
  case FbStatus_STOPPING: return "STOPPING"
  case FbStatus_STOPPED: return "STOPPED"
  case FbStatus_WARNING: return "WARNING"
  }
  return "<UNSET>"
}

func FbStatusFromString(s string) (FbStatus, error) {
  switch s {
  case "DEAD": return FbStatus_DEAD, nil 
  case "STARTING": return FbStatus_STARTING, nil 
  case "ALIVE": return FbStatus_ALIVE, nil 
  case "STOPPING": return FbStatus_STOPPING, nil 
  case "STOPPED": return FbStatus_STOPPED, nil 
  case "WARNING": return FbStatus_WARNING, nil 
  }
  return FbStatus(0), fmt.Errorf("not a valid FbStatus string")
}


func FbStatusPtr(v FbStatus) *FbStatus { return &v }

func (p FbStatus) MarshalText() ([]byte, error) {
return []byte(p.String()), nil
}

func (p *FbStatus) UnmarshalText(text []byte) error {
q, err := FbStatusFromString(string(text))
if (err != nil) {
return err
}
*p = q
return nil
}

func (p *FbStatus) Scan(value interface{}) error {
v, ok := value.(int64)
if !ok {
return errors.New("Scan value is not int64")
}
*p = FbStatus(v)
return nil
}

func (p * FbStatus) Value() (driver.Value, error) {
  if p == nil {
    return nil, nil
  }
return int64(*p), nil
}
type FacebookService interface {  //Standard base service

  // Returns a descriptive name of the service
  GetName(ctx context.Context) (r string, err error)
  // Returns the version of the service
  GetVersion(ctx context.Context) (r string, err error)
  // Gets the status of this service
  GetStatus(ctx context.Context) (r FbStatus, err error)
  // User friendly description of status, such as why the service is in
  // the dead or warning state, or what is being started or stopped.
  GetStatusDetails(ctx context.Context) (r string, err error)
  // Gets the counters for this service
  GetCounters(ctx context.Context) (r map[string]int64, err error)
  // Gets the value of a single counter
  // 
  // Parameters:
  //  - Key
  GetCounter(ctx context.Context, key string) (r int64, err error)
  // Sets an option
  // 
  // Parameters:
  //  - Key
  //  - Value
  SetOption(ctx context.Context, key string, value string) (err error)
  // Gets an option
  // 
  // Parameters:
  //  - Key
  GetOption(ctx context.Context, key string) (r string, err error)
  // Gets all options
  GetOptions(ctx context.Context) (r map[string]string, err error)
  // Returns a CPU profile over the given time interval (client and server
  // must agree on the profile format).
  // 
  // Parameters:
  //  - ProfileDurationInSec
  GetCpuProfile(ctx context.Context, profileDurationInSec int32) (r string, err error)
  // Returns the unix time that the server has been running since
  AliveSince(ctx context.Context) (r int64, err error)
  // Tell the server to reload its configuration, reopen log files, etc
  Reinitialize(ctx context.Context) (err error)
  // Suggest a shutdown to the server
  Shutdown(ctx context.Context) (err error)
}

//Standard base service
type FacebookServiceClient struct {
  c thrift.TClient
}

func NewFacebookServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *FacebookServiceClient {
  return &FacebookServiceClient{
    c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)),
  }
}

func NewFacebookServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *FacebookServiceClient {
  return &FacebookServiceClient{
    c: thrift.NewTStandardClient(iprot, oprot),
  }
}

func NewFacebookServiceClient(c thrift.TClient) *FacebookServiceClient {
  return &FacebookServiceClient{
    c: c,
  }
}

func (p *FacebookServiceClient) Client_() thrift.TClient {
  return p.c
}
// Returns a descriptive name of the service
func (p *FacebookServiceClient) GetName(ctx context.Context) (r string, err error) {
  var _args0 FacebookServiceGetNameArgs
  var _result1 FacebookServiceGetNameResult
  if err = p.Client_().Call(ctx, "getName", &_args0, &_result1); err != nil {
    return
  }
  return _result1.GetSuccess(), nil
}

// Returns the version of the service
func (p *FacebookServiceClient) GetVersion(ctx context.Context) (r string, err error) {
  var _args2 FacebookServiceGetVersionArgs
  var _result3 FacebookServiceGetVersionResult
  if err = p.Client_().Call(ctx, "getVersion", &_args2, &_result3); err != nil {
    return
  }
  return _result3.GetSuccess(), nil
}

// Gets the status of this service
func (p *FacebookServiceClient) GetStatus(ctx context.Context) (r FbStatus, err error) {
  var _args4 FacebookServiceGetStatusArgs
  var _result5 FacebookServiceGetStatusResult
  if err = p.Client_().Call(ctx, "getStatus", &_args4, &_result5); err != nil {
    return
  }
  return _result5.GetSuccess(), nil
}

// User friendly description of status, such as why the service is in
// the dead or warning state, or what is being started or stopped.
func (p *FacebookServiceClient) GetStatusDetails(ctx context.Context) (r string, err error) {
  var _args6 FacebookServiceGetStatusDetailsArgs
  var _result7 FacebookServiceGetStatusDetailsResult
  if err = p.Client_().Call(ctx, "getStatusDetails", &_args6, &_result7); err != nil {
    return
  }
  return _result7.GetSuccess(), nil
}

// Gets the counters for this service
func (p *FacebookServiceClient) GetCounters(ctx context.Context) (r map[string]int64, err error) {
  var _args8 FacebookServiceGetCountersArgs
  var _result9 FacebookServiceGetCountersResult
  if err = p.Client_().Call(ctx, "getCounters", &_args8, &_result9); err != nil {
    return
  }
  return _result9.GetSuccess(), nil
}

// Gets the value of a single counter
// 
// Parameters:
//  - Key
func (p *FacebookServiceClient) GetCounter(ctx context.Context, key string) (r int64, err error) {
  var _args10 FacebookServiceGetCounterArgs
  _args10.Key = key
  var _result11 FacebookServiceGetCounterResult
  if err = p.Client_().Call(ctx, "getCounter", &_args10, &_result11); err != nil {
    return
  }
  return _result11.GetSuccess(), nil
}

// Sets an option
// 
// Parameters:
//  - Key
//  - Value
func (p *FacebookServiceClient) SetOption(ctx context.Context, key string, value string) (err error) {
  var _args12 FacebookServiceSetOptionArgs
  _args12.Key = key
  _args12.Value = value
  var _result13 FacebookServiceSetOptionResult
  if err = p.Client_().Call(ctx, "setOption", &_args12, &_result13); err != nil {
    return
  }
  return nil
}

// Gets an option
// 
// Parameters:
//  - Key
func (p *FacebookServiceClient) GetOption(ctx context.Context, key string) (r string, err error) {
  var _args14 FacebookServiceGetOptionArgs
  _args14.Key = key
  var _result15 FacebookServiceGetOptionResult
  if err = p.Client_().Call(ctx, "getOption", &_args14, &_result15); err != nil {
    return
  }
  return _result15.GetSuccess(), nil
}

// Gets all options
func (p *FacebookServiceClient) GetOptions(ctx context.Context) (r map[string]string, err error) {
  var _args16 FacebookServiceGetOptionsArgs
  var _result17 FacebookServiceGetOptionsResult
  if err = p.Client_().Call(ctx, "getOptions", &_args16, &_result17); err != nil {
    return
  }
  return _result17.GetSuccess(), nil
}

// Returns a CPU profile over the given time interval (client and server
// must agree on the profile format).
// 
// Parameters:
//  - ProfileDurationInSec
func (p *FacebookServiceClient) GetCpuProfile(ctx context.Context, profileDurationInSec int32) (r string, err error) {
  var _args18 FacebookServiceGetCpuProfileArgs
  _args18.ProfileDurationInSec = profileDurationInSec
  var _result19 FacebookServiceGetCpuProfileResult
  if err = p.Client_().Call(ctx, "getCpuProfile", &_args18, &_result19); err != nil {
    return
  }
  return _result19.GetSuccess(), nil
}

// Returns the unix time that the server has been running since
func (p *FacebookServiceClient) AliveSince(ctx context.Context) (r int64, err error) {
  var _args20 FacebookServiceAliveSinceArgs
  var _result21 FacebookServiceAliveSinceResult
  if err = p.Client_().Call(ctx, "aliveSince", &_args20, &_result21); err != nil {
    return
  }
  return _result21.GetSuccess(), nil
}

// Tell the server to reload its configuration, reopen log files, etc
func (p *FacebookServiceClient) Reinitialize(ctx context.Context) (err error) {
  var _args22 FacebookServiceReinitializeArgs
  if err := p.Client_().Call(ctx, "reinitialize", &_args22, nil); err != nil {
    return err
  }
  return nil
}

// Suggest a shutdown to the server
func (p *FacebookServiceClient) Shutdown(ctx context.Context) (err error) {
  var _args23 FacebookServiceShutdownArgs
  if err := p.Client_().Call(ctx, "shutdown", &_args23, nil); err != nil {
    return err
  }
  return nil
}

type FacebookServiceProcessor struct {
  processorMap map[string]thrift.TProcessorFunction
  handler FacebookService
}

func (p *FacebookServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) {
  p.processorMap[key] = processor
}

func (p *FacebookServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) {
  processor, ok = p.processorMap[key]
  return processor, ok
}

func (p *FacebookServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction {
  return p.processorMap
}

func NewFacebookServiceProcessor(handler FacebookService) *FacebookServiceProcessor {

  self24 := &FacebookServiceProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)}
  self24.processorMap["getName"] = &facebookServiceProcessorGetName{handler:handler}
  self24.processorMap["getVersion"] = &facebookServiceProcessorGetVersion{handler:handler}
  self24.processorMap["getStatus"] = &facebookServiceProcessorGetStatus{handler:handler}
  self24.processorMap["getStatusDetails"] = &facebookServiceProcessorGetStatusDetails{handler:handler}
  self24.processorMap["getCounters"] = &facebookServiceProcessorGetCounters{handler:handler}
  self24.processorMap["getCounter"] = &facebookServiceProcessorGetCounter{handler:handler}
  self24.processorMap["setOption"] = &facebookServiceProcessorSetOption{handler:handler}
  self24.processorMap["getOption"] = &facebookServiceProcessorGetOption{handler:handler}
  self24.processorMap["getOptions"] = &facebookServiceProcessorGetOptions{handler:handler}
  self24.processorMap["getCpuProfile"] = &facebookServiceProcessorGetCpuProfile{handler:handler}
  self24.processorMap["aliveSince"] = &facebookServiceProcessorAliveSince{handler:handler}
  self24.processorMap["reinitialize"] = &facebookServiceProcessorReinitialize{handler:handler}
  self24.processorMap["shutdown"] = &facebookServiceProcessorShutdown{handler:handler}
return self24
}

func (p *FacebookServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  name, _, seqId, err := iprot.ReadMessageBegin()
  if err != nil { return false, err }
  if processor, ok := p.GetProcessorFunction(name); ok {
    return processor.Process(ctx, seqId, iprot, oprot)
  }
  iprot.Skip(thrift.STRUCT)
  iprot.ReadMessageEnd()
  x25 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name)
  oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId)
  x25.Write(oprot)
  oprot.WriteMessageEnd()
  oprot.Flush(ctx)
  return false, x25

}

type facebookServiceProcessorGetName struct {
  handler FacebookService
}

func (p *facebookServiceProcessorGetName) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := FacebookServiceGetNameArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("getName", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := FacebookServiceGetNameResult{}
var retval string
  var err2 error
  if retval, err2 = p.handler.GetName(ctx); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getName: " + err2.Error())
    oprot.WriteMessageBegin("getName", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = &retval
}
  if err2 = oprot.WriteMessageBegin("getName", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type facebookServiceProcessorGetVersion struct {
  handler FacebookService
}

func (p *facebookServiceProcessorGetVersion) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := FacebookServiceGetVersionArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("getVersion", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := FacebookServiceGetVersionResult{}
var retval string
  var err2 error
  if retval, err2 = p.handler.GetVersion(ctx); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getVersion: " + err2.Error())
    oprot.WriteMessageBegin("getVersion", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = &retval
}
  if err2 = oprot.WriteMessageBegin("getVersion", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type facebookServiceProcessorGetStatus struct {
  handler FacebookService
}

func (p *facebookServiceProcessorGetStatus) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := FacebookServiceGetStatusArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("getStatus", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := FacebookServiceGetStatusResult{}
var retval FbStatus
  var err2 error
  if retval, err2 = p.handler.GetStatus(ctx); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getStatus: " + err2.Error())
    oprot.WriteMessageBegin("getStatus", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = &retval
}
  if err2 = oprot.WriteMessageBegin("getStatus", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type facebookServiceProcessorGetStatusDetails struct {
  handler FacebookService
}

func (p *facebookServiceProcessorGetStatusDetails) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := FacebookServiceGetStatusDetailsArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("getStatusDetails", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := FacebookServiceGetStatusDetailsResult{}
var retval string
  var err2 error
  if retval, err2 = p.handler.GetStatusDetails(ctx); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getStatusDetails: " + err2.Error())
    oprot.WriteMessageBegin("getStatusDetails", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = &retval
}
  if err2 = oprot.WriteMessageBegin("getStatusDetails", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type facebookServiceProcessorGetCounters struct {
  handler FacebookService
}

func (p *facebookServiceProcessorGetCounters) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := FacebookServiceGetCountersArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("getCounters", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := FacebookServiceGetCountersResult{}
var retval map[string]int64
  var err2 error
  if retval, err2 = p.handler.GetCounters(ctx); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getCounters: " + err2.Error())
    oprot.WriteMessageBegin("getCounters", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("getCounters", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type facebookServiceProcessorGetCounter struct {
  handler FacebookService
}

func (p *facebookServiceProcessorGetCounter) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := FacebookServiceGetCounterArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("getCounter", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := FacebookServiceGetCounterResult{}
var retval int64
  var err2 error
  if retval, err2 = p.handler.GetCounter(ctx, args.Key); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getCounter: " + err2.Error())
    oprot.WriteMessageBegin("getCounter", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = &retval
}
  if err2 = oprot.WriteMessageBegin("getCounter", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type facebookServiceProcessorSetOption struct {
  handler FacebookService
}

func (p *facebookServiceProcessorSetOption) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := FacebookServiceSetOptionArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("setOption", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := FacebookServiceSetOptionResult{}
  var err2 error
  if err2 = p.handler.SetOption(ctx, args.Key, args.Value); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing setOption: " + err2.Error())
    oprot.WriteMessageBegin("setOption", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  if err2 = oprot.WriteMessageBegin("setOption", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type facebookServiceProcessorGetOption struct {
  handler FacebookService
}

func (p *facebookServiceProcessorGetOption) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := FacebookServiceGetOptionArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("getOption", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := FacebookServiceGetOptionResult{}
var retval string
  var err2 error
  if retval, err2 = p.handler.GetOption(ctx, args.Key); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getOption: " + err2.Error())
    oprot.WriteMessageBegin("getOption", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = &retval
}
  if err2 = oprot.WriteMessageBegin("getOption", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type facebookServiceProcessorGetOptions struct {
  handler FacebookService
}

func (p *facebookServiceProcessorGetOptions) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := FacebookServiceGetOptionsArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("getOptions", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := FacebookServiceGetOptionsResult{}
var retval map[string]string
  var err2 error
  if retval, err2 = p.handler.GetOptions(ctx); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getOptions: " + err2.Error())
    oprot.WriteMessageBegin("getOptions", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("getOptions", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type facebookServiceProcessorGetCpuProfile struct {
  handler FacebookService
}

func (p *facebookServiceProcessorGetCpuProfile) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := FacebookServiceGetCpuProfileArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("getCpuProfile", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := FacebookServiceGetCpuProfileResult{}
var retval string
  var err2 error
  if retval, err2 = p.handler.GetCpuProfile(ctx, args.ProfileDurationInSec); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getCpuProfile: " + err2.Error())
    oprot.WriteMessageBegin("getCpuProfile", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = &retval
}
  if err2 = oprot.WriteMessageBegin("getCpuProfile", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type facebookServiceProcessorAliveSince struct {
  handler FacebookService
}

func (p *facebookServiceProcessorAliveSince) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := FacebookServiceAliveSinceArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("aliveSince", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := FacebookServiceAliveSinceResult{}
var retval int64
  var err2 error
  if retval, err2 = p.handler.AliveSince(ctx); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing aliveSince: " + err2.Error())
    oprot.WriteMessageBegin("aliveSince", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = &retval
}
  if err2 = oprot.WriteMessageBegin("aliveSince", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type facebookServiceProcessorReinitialize struct {
  handler FacebookService
}

func (p *facebookServiceProcessorReinitialize) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := FacebookServiceReinitializeArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    return false, err
  }

  iprot.ReadMessageEnd()
  var err2 error
  if err2 = p.handler.Reinitialize(ctx); err2 != nil {
    return true, err2
  }
  return true, nil
}

type facebookServiceProcessorShutdown struct {
  handler FacebookService
}

func (p *facebookServiceProcessorShutdown) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := FacebookServiceShutdownArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    return false, err
  }

  iprot.ReadMessageEnd()
  var err2 error
  if err2 = p.handler.Shutdown(ctx); err2 != nil {
    return true, err2
  }
  return true, nil
}


// HELPER FUNCTIONS AND STRUCTURES

type FacebookServiceGetNameArgs struct {
}

func NewFacebookServiceGetNameArgs() *FacebookServiceGetNameArgs {
  return &FacebookServiceGetNameArgs{}
}

func (p *FacebookServiceGetNameArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    if err := iprot.Skip(fieldTypeId); err != nil {
      return err
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceGetNameArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("getName_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceGetNameArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceGetNameArgs(%+v)", *p)
}

// Attributes:
//  - Success
type FacebookServiceGetNameResult struct {
  Success *string `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewFacebookServiceGetNameResult() *FacebookServiceGetNameResult {
  return &FacebookServiceGetNameResult{}
}

var FacebookServiceGetNameResult_Success_DEFAULT string
func (p *FacebookServiceGetNameResult) GetSuccess() string {
  if !p.IsSetSuccess() {
    return FacebookServiceGetNameResult_Success_DEFAULT
  }
return *p.Success
}
func (p *FacebookServiceGetNameResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *FacebookServiceGetNameResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceGetNameResult)  ReadField0(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 0: ", err)
} else {
  p.Success = &v
}
  return nil
}

func (p *FacebookServiceGetNameResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("getName_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceGetNameResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRING, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteString(string(*p.Success)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *FacebookServiceGetNameResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceGetNameResult(%+v)", *p)
}

type FacebookServiceGetVersionArgs struct {
}

func NewFacebookServiceGetVersionArgs() *FacebookServiceGetVersionArgs {
  return &FacebookServiceGetVersionArgs{}
}

func (p *FacebookServiceGetVersionArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    if err := iprot.Skip(fieldTypeId); err != nil {
      return err
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceGetVersionArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("getVersion_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceGetVersionArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceGetVersionArgs(%+v)", *p)
}

// Attributes:
//  - Success
type FacebookServiceGetVersionResult struct {
  Success *string `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewFacebookServiceGetVersionResult() *FacebookServiceGetVersionResult {
  return &FacebookServiceGetVersionResult{}
}

var FacebookServiceGetVersionResult_Success_DEFAULT string
func (p *FacebookServiceGetVersionResult) GetSuccess() string {
  if !p.IsSetSuccess() {
    return FacebookServiceGetVersionResult_Success_DEFAULT
  }
return *p.Success
}
func (p *FacebookServiceGetVersionResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *FacebookServiceGetVersionResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceGetVersionResult)  ReadField0(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 0: ", err)
} else {
  p.Success = &v
}
  return nil
}

func (p *FacebookServiceGetVersionResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("getVersion_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceGetVersionResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRING, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteString(string(*p.Success)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *FacebookServiceGetVersionResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceGetVersionResult(%+v)", *p)
}

type FacebookServiceGetStatusArgs struct {
}

func NewFacebookServiceGetStatusArgs() *FacebookServiceGetStatusArgs {
  return &FacebookServiceGetStatusArgs{}
}

func (p *FacebookServiceGetStatusArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    if err := iprot.Skip(fieldTypeId); err != nil {
      return err
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceGetStatusArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("getStatus_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceGetStatusArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceGetStatusArgs(%+v)", *p)
}

// Attributes:
//  - Success
type FacebookServiceGetStatusResult struct {
  Success *FbStatus `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewFacebookServiceGetStatusResult() *FacebookServiceGetStatusResult {
  return &FacebookServiceGetStatusResult{}
}

var FacebookServiceGetStatusResult_Success_DEFAULT FbStatus
func (p *FacebookServiceGetStatusResult) GetSuccess() FbStatus {
  if !p.IsSetSuccess() {
    return FacebookServiceGetStatusResult_Success_DEFAULT
  }
return *p.Success
}
func (p *FacebookServiceGetStatusResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *FacebookServiceGetStatusResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceGetStatusResult)  ReadField0(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 0: ", err)
} else {
  temp := FbStatus(v)
  p.Success = &temp
}
  return nil
}

func (p *FacebookServiceGetStatusResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("getStatus_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceGetStatusResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.I32, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteI32(int32(*p.Success)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *FacebookServiceGetStatusResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceGetStatusResult(%+v)", *p)
}

type FacebookServiceGetStatusDetailsArgs struct {
}

func NewFacebookServiceGetStatusDetailsArgs() *FacebookServiceGetStatusDetailsArgs {
  return &FacebookServiceGetStatusDetailsArgs{}
}

func (p *FacebookServiceGetStatusDetailsArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    if err := iprot.Skip(fieldTypeId); err != nil {
      return err
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceGetStatusDetailsArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("getStatusDetails_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceGetStatusDetailsArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceGetStatusDetailsArgs(%+v)", *p)
}

// Attributes:
//  - Success
type FacebookServiceGetStatusDetailsResult struct {
  Success *string `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewFacebookServiceGetStatusDetailsResult() *FacebookServiceGetStatusDetailsResult {
  return &FacebookServiceGetStatusDetailsResult{}
}

var FacebookServiceGetStatusDetailsResult_Success_DEFAULT string
func (p *FacebookServiceGetStatusDetailsResult) GetSuccess() string {
  if !p.IsSetSuccess() {
    return FacebookServiceGetStatusDetailsResult_Success_DEFAULT
  }
return *p.Success
}
func (p *FacebookServiceGetStatusDetailsResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *FacebookServiceGetStatusDetailsResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceGetStatusDetailsResult)  ReadField0(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 0: ", err)
} else {
  p.Success = &v
}
  return nil
}

func (p *FacebookServiceGetStatusDetailsResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("getStatusDetails_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceGetStatusDetailsResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRING, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteString(string(*p.Success)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *FacebookServiceGetStatusDetailsResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceGetStatusDetailsResult(%+v)", *p)
}

type FacebookServiceGetCountersArgs struct {
}

func NewFacebookServiceGetCountersArgs() *FacebookServiceGetCountersArgs {
  return &FacebookServiceGetCountersArgs{}
}

func (p *FacebookServiceGetCountersArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    if err := iprot.Skip(fieldTypeId); err != nil {
      return err
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceGetCountersArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("getCounters_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceGetCountersArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceGetCountersArgs(%+v)", *p)
}

// Attributes:
//  - Success
type FacebookServiceGetCountersResult struct {
  Success map[string]int64 `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewFacebookServiceGetCountersResult() *FacebookServiceGetCountersResult {
  return &FacebookServiceGetCountersResult{}
}

var FacebookServiceGetCountersResult_Success_DEFAULT map[string]int64

func (p *FacebookServiceGetCountersResult) GetSuccess() map[string]int64 {
  return p.Success
}
func (p *FacebookServiceGetCountersResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *FacebookServiceGetCountersResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.MAP {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceGetCountersResult)  ReadField0(iprot thrift.TProtocol) error {
  _, _, size, err := iprot.ReadMapBegin()
  if err != nil {
    return thrift.PrependError("error reading map begin: ", err)
  }
  tMap := make(map[string]int64, size)
  p.Success =  tMap
  for i := 0; i < size; i ++ {
var _key26 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _key26 = v
}
var _val27 int64
    if v, err := iprot.ReadI64(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _val27 = v
}
    p.Success[_key26] = _val27
  }
  if err := iprot.ReadMapEnd(); err != nil {
    return thrift.PrependError("error reading map end: ", err)
  }
  return nil
}

func (p *FacebookServiceGetCountersResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("getCounters_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceGetCountersResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.MAP, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteMapBegin(thrift.STRING, thrift.I64, len(p.Success)); err != nil {
      return thrift.PrependError("error writing map begin: ", err)
    }
    for k, v := range p.Success {
      if err := oprot.WriteString(string(k)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
      if err := oprot.WriteI64(int64(v)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    }
    if err := oprot.WriteMapEnd(); err != nil {
      return thrift.PrependError("error writing map end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *FacebookServiceGetCountersResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceGetCountersResult(%+v)", *p)
}

// Attributes:
//  - Key
type FacebookServiceGetCounterArgs struct {
  Key string `thrift:"key,1" db:"key" json:"key"`
}

func NewFacebookServiceGetCounterArgs() *FacebookServiceGetCounterArgs {
  return &FacebookServiceGetCounterArgs{}
}


func (p *FacebookServiceGetCounterArgs) GetKey() string {
  return p.Key
}
func (p *FacebookServiceGetCounterArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceGetCounterArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Key = v
}
  return nil
}

func (p *FacebookServiceGetCounterArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("getCounter_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceGetCounterArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("key", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) }
  if err := oprot.WriteString(string(p.Key)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.key (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) }
  return err
}

func (p *FacebookServiceGetCounterArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceGetCounterArgs(%+v)", *p)
}

// Attributes:
//  - Success
type FacebookServiceGetCounterResult struct {
  Success *int64 `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewFacebookServiceGetCounterResult() *FacebookServiceGetCounterResult {
  return &FacebookServiceGetCounterResult{}
}

var FacebookServiceGetCounterResult_Success_DEFAULT int64
func (p *FacebookServiceGetCounterResult) GetSuccess() int64 {
  if !p.IsSetSuccess() {
    return FacebookServiceGetCounterResult_Success_DEFAULT
  }
return *p.Success
}
func (p *FacebookServiceGetCounterResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *FacebookServiceGetCounterResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.I64 {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceGetCounterResult)  ReadField0(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI64(); err != nil {
  return thrift.PrependError("error reading field 0: ", err)
} else {
  p.Success = &v
}
  return nil
}

func (p *FacebookServiceGetCounterResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("getCounter_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceGetCounterResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.I64, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteI64(int64(*p.Success)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *FacebookServiceGetCounterResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceGetCounterResult(%+v)", *p)
}

// Attributes:
//  - Key
//  - Value
type FacebookServiceSetOptionArgs struct {
  Key string `thrift:"key,1" db:"key" json:"key"`
  Value string `thrift:"value,2" db:"value" json:"value"`
}

func NewFacebookServiceSetOptionArgs() *FacebookServiceSetOptionArgs {
  return &FacebookServiceSetOptionArgs{}
}


func (p *FacebookServiceSetOptionArgs) GetKey() string {
  return p.Key
}

func (p *FacebookServiceSetOptionArgs) GetValue() string {
  return p.Value
}
func (p *FacebookServiceSetOptionArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceSetOptionArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Key = v
}
  return nil
}

func (p *FacebookServiceSetOptionArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.Value = v
}
  return nil
}

func (p *FacebookServiceSetOptionArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("setOption_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceSetOptionArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("key", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) }
  if err := oprot.WriteString(string(p.Key)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.key (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) }
  return err
}

func (p *FacebookServiceSetOptionArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) }
  if err := oprot.WriteString(string(p.Value)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) }
  return err
}

func (p *FacebookServiceSetOptionArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceSetOptionArgs(%+v)", *p)
}

type FacebookServiceSetOptionResult struct {
}

func NewFacebookServiceSetOptionResult() *FacebookServiceSetOptionResult {
  return &FacebookServiceSetOptionResult{}
}

func (p *FacebookServiceSetOptionResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    if err := iprot.Skip(fieldTypeId); err != nil {
      return err
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceSetOptionResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("setOption_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceSetOptionResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceSetOptionResult(%+v)", *p)
}

// Attributes:
//  - Key
type FacebookServiceGetOptionArgs struct {
  Key string `thrift:"key,1" db:"key" json:"key"`
}

func NewFacebookServiceGetOptionArgs() *FacebookServiceGetOptionArgs {
  return &FacebookServiceGetOptionArgs{}
}


func (p *FacebookServiceGetOptionArgs) GetKey() string {
  return p.Key
}
func (p *FacebookServiceGetOptionArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceGetOptionArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Key = v
}
  return nil
}

func (p *FacebookServiceGetOptionArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("getOption_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceGetOptionArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("key", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) }
  if err := oprot.WriteString(string(p.Key)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.key (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) }
  return err
}

func (p *FacebookServiceGetOptionArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceGetOptionArgs(%+v)", *p)
}

// Attributes:
//  - Success
type FacebookServiceGetOptionResult struct {
  Success *string `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewFacebookServiceGetOptionResult() *FacebookServiceGetOptionResult {
  return &FacebookServiceGetOptionResult{}
}

var FacebookServiceGetOptionResult_Success_DEFAULT string
func (p *FacebookServiceGetOptionResult) GetSuccess() string {
  if !p.IsSetSuccess() {
    return FacebookServiceGetOptionResult_Success_DEFAULT
  }
return *p.Success
}
func (p *FacebookServiceGetOptionResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *FacebookServiceGetOptionResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceGetOptionResult)  ReadField0(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 0: ", err)
} else {
  p.Success = &v
}
  return nil
}

func (p *FacebookServiceGetOptionResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("getOption_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceGetOptionResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRING, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteString(string(*p.Success)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *FacebookServiceGetOptionResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceGetOptionResult(%+v)", *p)
}

type FacebookServiceGetOptionsArgs struct {
}

func NewFacebookServiceGetOptionsArgs() *FacebookServiceGetOptionsArgs {
  return &FacebookServiceGetOptionsArgs{}
}

func (p *FacebookServiceGetOptionsArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    if err := iprot.Skip(fieldTypeId); err != nil {
      return err
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceGetOptionsArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("getOptions_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceGetOptionsArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceGetOptionsArgs(%+v)", *p)
}

// Attributes:
//  - Success
type FacebookServiceGetOptionsResult struct {
  Success map[string]string `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewFacebookServiceGetOptionsResult() *FacebookServiceGetOptionsResult {
  return &FacebookServiceGetOptionsResult{}
}

var FacebookServiceGetOptionsResult_Success_DEFAULT map[string]string

func (p *FacebookServiceGetOptionsResult) GetSuccess() map[string]string {
  return p.Success
}
func (p *FacebookServiceGetOptionsResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *FacebookServiceGetOptionsResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.MAP {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceGetOptionsResult)  ReadField0(iprot thrift.TProtocol) error {
  _, _, size, err := iprot.ReadMapBegin()
  if err != nil {
    return thrift.PrependError("error reading map begin: ", err)
  }
  tMap := make(map[string]string, size)
  p.Success =  tMap
  for i := 0; i < size; i ++ {
var _key28 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _key28 = v
}
var _val29 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _val29 = v
}
    p.Success[_key28] = _val29
  }
  if err := iprot.ReadMapEnd(); err != nil {
    return thrift.PrependError("error reading map end: ", err)
  }
  return nil
}

func (p *FacebookServiceGetOptionsResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("getOptions_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceGetOptionsResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.MAP, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Success)); err != nil {
      return thrift.PrependError("error writing map begin: ", err)
    }
    for k, v := range p.Success {
      if err := oprot.WriteString(string(k)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
      if err := oprot.WriteString(string(v)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    }
    if err := oprot.WriteMapEnd(); err != nil {
      return thrift.PrependError("error writing map end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *FacebookServiceGetOptionsResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceGetOptionsResult(%+v)", *p)
}

// Attributes:
//  - ProfileDurationInSec
type FacebookServiceGetCpuProfileArgs struct {
  ProfileDurationInSec int32 `thrift:"profileDurationInSec,1" db:"profileDurationInSec" json:"profileDurationInSec"`
}

func NewFacebookServiceGetCpuProfileArgs() *FacebookServiceGetCpuProfileArgs {
  return &FacebookServiceGetCpuProfileArgs{}
}


func (p *FacebookServiceGetCpuProfileArgs) GetProfileDurationInSec() int32 {
  return p.ProfileDurationInSec
}
func (p *FacebookServiceGetCpuProfileArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceGetCpuProfileArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.ProfileDurationInSec = v
}
  return nil
}

func (p *FacebookServiceGetCpuProfileArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("getCpuProfile_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceGetCpuProfileArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("profileDurationInSec", thrift.I32, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:profileDurationInSec: ", p), err) }
  if err := oprot.WriteI32(int32(p.ProfileDurationInSec)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.profileDurationInSec (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:profileDurationInSec: ", p), err) }
  return err
}

func (p *FacebookServiceGetCpuProfileArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceGetCpuProfileArgs(%+v)", *p)
}

// Attributes:
//  - Success
type FacebookServiceGetCpuProfileResult struct {
  Success *string `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewFacebookServiceGetCpuProfileResult() *FacebookServiceGetCpuProfileResult {
  return &FacebookServiceGetCpuProfileResult{}
}

var FacebookServiceGetCpuProfileResult_Success_DEFAULT string
func (p *FacebookServiceGetCpuProfileResult) GetSuccess() string {
  if !p.IsSetSuccess() {
    return FacebookServiceGetCpuProfileResult_Success_DEFAULT
  }
return *p.Success
}
func (p *FacebookServiceGetCpuProfileResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *FacebookServiceGetCpuProfileResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceGetCpuProfileResult)  ReadField0(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 0: ", err)
} else {
  p.Success = &v
}
  return nil
}

func (p *FacebookServiceGetCpuProfileResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("getCpuProfile_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceGetCpuProfileResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRING, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteString(string(*p.Success)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *FacebookServiceGetCpuProfileResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceGetCpuProfileResult(%+v)", *p)
}

type FacebookServiceAliveSinceArgs struct {
}

func NewFacebookServiceAliveSinceArgs() *FacebookServiceAliveSinceArgs {
  return &FacebookServiceAliveSinceArgs{}
}

func (p *FacebookServiceAliveSinceArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    if err := iprot.Skip(fieldTypeId); err != nil {
      return err
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceAliveSinceArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("aliveSince_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceAliveSinceArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceAliveSinceArgs(%+v)", *p)
}

// Attributes:
//  - Success
type FacebookServiceAliveSinceResult struct {
  Success *int64 `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewFacebookServiceAliveSinceResult() *FacebookServiceAliveSinceResult {
  return &FacebookServiceAliveSinceResult{}
}

var FacebookServiceAliveSinceResult_Success_DEFAULT int64
func (p *FacebookServiceAliveSinceResult) GetSuccess() int64 {
  if !p.IsSetSuccess() {
    return FacebookServiceAliveSinceResult_Success_DEFAULT
  }
return *p.Success
}
func (p *FacebookServiceAliveSinceResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *FacebookServiceAliveSinceResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.I64 {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceAliveSinceResult)  ReadField0(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI64(); err != nil {
  return thrift.PrependError("error reading field 0: ", err)
} else {
  p.Success = &v
}
  return nil
}

func (p *FacebookServiceAliveSinceResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("aliveSince_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceAliveSinceResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.I64, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteI64(int64(*p.Success)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *FacebookServiceAliveSinceResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceAliveSinceResult(%+v)", *p)
}

type FacebookServiceReinitializeArgs struct {
}

func NewFacebookServiceReinitializeArgs() *FacebookServiceReinitializeArgs {
  return &FacebookServiceReinitializeArgs{}
}

func (p *FacebookServiceReinitializeArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    if err := iprot.Skip(fieldTypeId); err != nil {
      return err
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceReinitializeArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("reinitialize_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceReinitializeArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceReinitializeArgs(%+v)", *p)
}

type FacebookServiceShutdownArgs struct {
}

func NewFacebookServiceShutdownArgs() *FacebookServiceShutdownArgs {
  return &FacebookServiceShutdownArgs{}
}

func (p *FacebookServiceShutdownArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    if err := iprot.Skip(fieldTypeId); err != nil {
      return err
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FacebookServiceShutdownArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("shutdown_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FacebookServiceShutdownArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FacebookServiceShutdownArgs(%+v)", *p)
}


