# Copyright (c) 2015 Uber Technologies, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

#
# Autogenerated by Thrift Compiler (0.9.2)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
#  options string: py:new_style,slots,dynamic
#

from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.protocol.TBase import TBase, TExceptionBase


class Iface(object):
  def testVoid(self):
    """
    Prints "testVoid()" and returns nothing.
    """
    pass

  def testString(self, thing):
    """
    Prints 'testString("%s")' with thing as '%s'
    @param string thing - the string to print
    @return string - returns the string 'thing'

    Parameters:
     - thing
    """
    pass

  def testByte(self, thing):
    """
    Prints 'testByte("%d")' with thing as '%d'
    @param byte thing - the byte to print
    @return byte - returns the byte 'thing'

    Parameters:
     - thing
    """
    pass

  def testI32(self, thing):
    """
    Prints 'testI32("%d")' with thing as '%d'
    @param i32 thing - the i32 to print
    @return i32 - returns the i32 'thing'

    Parameters:
     - thing
    """
    pass

  def testI64(self, thing):
    """
    Prints 'testI64("%d")' with thing as '%d'
    @param i64 thing - the i64 to print
    @return i64 - returns the i64 'thing'

    Parameters:
     - thing
    """
    pass

  def testDouble(self, thing):
    """
    Prints 'testDouble("%f")' with thing as '%f'
    @param double thing - the double to print
    @return double - returns the double 'thing'

    Parameters:
     - thing
    """
    pass

  def testBinary(self, thing):
    """
    Prints 'testBinary("%s")' where '%s' is a hex-formatted string of thing's data
    @param binary  thing - the binary data to print
    @return binary  - returns the binary 'thing'

    Parameters:
     - thing
    """
    pass

  def testStruct(self, thing):
    """
    Prints 'testStruct("{%s}")' where thing has been formatted into a string of comma separated values
    @param Xtruct thing - the Xtruct to print
    @return Xtruct - returns the Xtruct 'thing'

    Parameters:
     - thing
    """
    pass

  def testNest(self, thing):
    """
    Prints 'testNest("{%s}")' where thing has been formatted into a string of the nested struct
    @param Xtruct2 thing - the Xtruct2 to print
    @return Xtruct2 - returns the Xtruct2 'thing'

    Parameters:
     - thing
    """
    pass

  def testMap(self, thing):
    """
    Prints 'testMap("{%s")' where thing has been formatted into a string of  'key => value' pairs
     separated by commas and new lines
    @param map<i32,i32> thing - the map<i32,i32> to print
    @return map<i32,i32> - returns the map<i32,i32> 'thing'

    Parameters:
     - thing
    """
    pass

  def testStringMap(self, thing):
    """
    Prints 'testStringMap("{%s}")' where thing has been formatted into a string of  'key => value' pairs
     separated by commas and new lines
    @param map<string,string> thing - the map<string,string> to print
    @return map<string,string> - returns the map<string,string> 'thing'

    Parameters:
     - thing
    """
    pass

  def testSet(self, thing):
    """
    Prints 'testSet("{%s}")' where thing has been formatted into a string of  values
     separated by commas and new lines
    @param set<i32> thing - the set<i32> to print
    @return set<i32> - returns the set<i32> 'thing'

    Parameters:
     - thing
    """
    pass

  def testList(self, thing):
    """
    Prints 'testList("{%s}")' where thing has been formatted into a string of  values
     separated by commas and new lines
    @param list<i32> thing - the list<i32> to print
    @return list<i32> - returns the list<i32> 'thing'

    Parameters:
     - thing
    """
    pass

  def testEnum(self, thing):
    """
    Prints 'testEnum("%d")' where thing has been formatted into it's numeric value
    @param Numberz thing - the Numberz to print
    @return Numberz - returns the Numberz 'thing'

    Parameters:
     - thing
    """
    pass

  def testTypedef(self, thing):
    """
    Prints 'testTypedef("%d")' with thing as '%d'
    @param UserId thing - the UserId to print
    @return UserId - returns the UserId 'thing'

    Parameters:
     - thing
    """
    pass

  def testMapMap(self, hello):
    """
    Prints 'testMapMap("%d")' with hello as '%d'
    @param i32 hello - the i32 to print
    @return map<i32,map<i32,i32>> - returns a dictionary with these values:
      {-4 => {-4 => -4, -3 => -3, -2 => -2, -1 => -1, }, 4 => {1 => 1, 2 => 2, 3 => 3, 4 => 4, }, }

    Parameters:
     - hello
    """
    pass

  def testInsanity(self, argument):
    """
    So you think you've got this all worked, out eh?

    Creates a the returned map with these values and prints it out:
      { 1 => { 2 => argument,
               3 => argument,
             },
        2 => { 6 => <empty Insanity struct>, },
      }
    @return map<UserId, map<Numberz,Insanity>> - a map with the above values

    Parameters:
     - argument
    """
    pass

  def testMulti(self, arg0, arg1, arg2, arg3, arg4, arg5):
    """
    Prints 'testMulti()'
    @param byte arg0 -
    @param i32 arg1 -
    @param i64 arg2 -
    @param map<i16, string> arg3 -
    @param Numberz arg4 -
    @param UserId arg5 -
    @return Xtruct - returns an Xtruct with string_thing = "Hello2, byte_thing = arg0, i32_thing = arg1
       and i64_thing = arg2

    Parameters:
     - arg0
     - arg1
     - arg2
     - arg3
     - arg4
     - arg5
    """
    pass

  def testException(self, arg):
    """
    Print 'testException(%s)' with arg as '%s'
    @param string arg - a string indication what type of exception to throw
    if arg == "Xception" throw Xception with errorCode = 1001 and message = arg
    elsen if arg == "TException" throw TException
    else do not throw anything

    Parameters:
     - arg
    """
    pass

  def testMultiException(self, arg0, arg1):
    """
    Print 'testMultiException(%s, %s)' with arg0 as '%s' and arg1 as '%s'
    @param string arg - a string indication what type of exception to throw
    if arg0 == "Xception" throw Xception with errorCode = 1001 and message = "This is an Xception"
    elsen if arg0 == "Xception2" throw Xception2 with errorCode = 2002 and message = "This is an Xception2"
    else do not throw anything
    @return Xtruct - an Xtruct with string_thing = arg1

    Parameters:
     - arg0
     - arg1
    """
    pass

  def testOneway(self, secondsToSleep):
    """
    Print 'testOneway(%d): Sleeping...' with secondsToSleep as '%d'
    sleep 'secondsToSleep'
    Print 'testOneway(%d): done sleeping!' with secondsToSleep as '%d'
    @param i32 secondsToSleep - the number of seconds to sleep

    Parameters:
     - secondsToSleep
    """
    pass


class Client(Iface):
  def __init__(self, iprot, oprot=None):
    self._iprot = self._oprot = iprot
    if oprot is not None:
      self._oprot = oprot
    self._seqid = 0

  def testVoid(self):
    """
    Prints "testVoid()" and returns nothing.
    """
    self.send_testVoid()
    self.recv_testVoid()

  def send_testVoid(self):
    self._oprot.writeMessageBegin('testVoid', TMessageType.CALL, self._seqid)
    args = testVoid_args()
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_testVoid(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = testVoid_result()
    result.read(iprot)
    iprot.readMessageEnd()
    return

  def testString(self, thing):
    """
    Prints 'testString("%s")' with thing as '%s'
    @param string thing - the string to print
    @return string - returns the string 'thing'

    Parameters:
     - thing
    """
    self.send_testString(thing)
    return self.recv_testString()

  def send_testString(self, thing):
    self._oprot.writeMessageBegin('testString', TMessageType.CALL, self._seqid)
    args = testString_args()
    args.thing = thing
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_testString(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = testString_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    raise TApplicationException(TApplicationException.MISSING_RESULT, "testString failed: unknown result");

  def testByte(self, thing):
    """
    Prints 'testByte("%d")' with thing as '%d'
    @param byte thing - the byte to print
    @return byte - returns the byte 'thing'

    Parameters:
     - thing
    """
    self.send_testByte(thing)
    return self.recv_testByte()

  def send_testByte(self, thing):
    self._oprot.writeMessageBegin('testByte', TMessageType.CALL, self._seqid)
    args = testByte_args()
    args.thing = thing
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_testByte(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = testByte_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    raise TApplicationException(TApplicationException.MISSING_RESULT, "testByte failed: unknown result");

  def testI32(self, thing):
    """
    Prints 'testI32("%d")' with thing as '%d'
    @param i32 thing - the i32 to print
    @return i32 - returns the i32 'thing'

    Parameters:
     - thing
    """
    self.send_testI32(thing)
    return self.recv_testI32()

  def send_testI32(self, thing):
    self._oprot.writeMessageBegin('testI32', TMessageType.CALL, self._seqid)
    args = testI32_args()
    args.thing = thing
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_testI32(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = testI32_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    raise TApplicationException(TApplicationException.MISSING_RESULT, "testI32 failed: unknown result");

  def testI64(self, thing):
    """
    Prints 'testI64("%d")' with thing as '%d'
    @param i64 thing - the i64 to print
    @return i64 - returns the i64 'thing'

    Parameters:
     - thing
    """
    self.send_testI64(thing)
    return self.recv_testI64()

  def send_testI64(self, thing):
    self._oprot.writeMessageBegin('testI64', TMessageType.CALL, self._seqid)
    args = testI64_args()
    args.thing = thing
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_testI64(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = testI64_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    raise TApplicationException(TApplicationException.MISSING_RESULT, "testI64 failed: unknown result");

  def testDouble(self, thing):
    """
    Prints 'testDouble("%f")' with thing as '%f'
    @param double thing - the double to print
    @return double - returns the double 'thing'

    Parameters:
     - thing
    """
    self.send_testDouble(thing)
    return self.recv_testDouble()

  def send_testDouble(self, thing):
    self._oprot.writeMessageBegin('testDouble', TMessageType.CALL, self._seqid)
    args = testDouble_args()
    args.thing = thing
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_testDouble(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = testDouble_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    raise TApplicationException(TApplicationException.MISSING_RESULT, "testDouble failed: unknown result");

  def testBinary(self, thing):
    """
    Prints 'testBinary("%s")' where '%s' is a hex-formatted string of thing's data
    @param binary  thing - the binary data to print
    @return binary  - returns the binary 'thing'

    Parameters:
     - thing
    """
    self.send_testBinary(thing)
    return self.recv_testBinary()

  def send_testBinary(self, thing):
    self._oprot.writeMessageBegin('testBinary', TMessageType.CALL, self._seqid)
    args = testBinary_args()
    args.thing = thing
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_testBinary(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = testBinary_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    raise TApplicationException(TApplicationException.MISSING_RESULT, "testBinary failed: unknown result");

  def testStruct(self, thing):
    """
    Prints 'testStruct("{%s}")' where thing has been formatted into a string of comma separated values
    @param Xtruct thing - the Xtruct to print
    @return Xtruct - returns the Xtruct 'thing'

    Parameters:
     - thing
    """
    self.send_testStruct(thing)
    return self.recv_testStruct()

  def send_testStruct(self, thing):
    self._oprot.writeMessageBegin('testStruct', TMessageType.CALL, self._seqid)
    args = testStruct_args()
    args.thing = thing
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_testStruct(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = testStruct_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    raise TApplicationException(TApplicationException.MISSING_RESULT, "testStruct failed: unknown result");

  def testNest(self, thing):
    """
    Prints 'testNest("{%s}")' where thing has been formatted into a string of the nested struct
    @param Xtruct2 thing - the Xtruct2 to print
    @return Xtruct2 - returns the Xtruct2 'thing'

    Parameters:
     - thing
    """
    self.send_testNest(thing)
    return self.recv_testNest()

  def send_testNest(self, thing):
    self._oprot.writeMessageBegin('testNest', TMessageType.CALL, self._seqid)
    args = testNest_args()
    args.thing = thing
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_testNest(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = testNest_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    raise TApplicationException(TApplicationException.MISSING_RESULT, "testNest failed: unknown result");

  def testMap(self, thing):
    """
    Prints 'testMap("{%s")' where thing has been formatted into a string of  'key => value' pairs
     separated by commas and new lines
    @param map<i32,i32> thing - the map<i32,i32> to print
    @return map<i32,i32> - returns the map<i32,i32> 'thing'

    Parameters:
     - thing
    """
    self.send_testMap(thing)
    return self.recv_testMap()

  def send_testMap(self, thing):
    self._oprot.writeMessageBegin('testMap', TMessageType.CALL, self._seqid)
    args = testMap_args()
    args.thing = thing
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_testMap(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = testMap_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    raise TApplicationException(TApplicationException.MISSING_RESULT, "testMap failed: unknown result");

  def testStringMap(self, thing):
    """
    Prints 'testStringMap("{%s}")' where thing has been formatted into a string of  'key => value' pairs
     separated by commas and new lines
    @param map<string,string> thing - the map<string,string> to print
    @return map<string,string> - returns the map<string,string> 'thing'

    Parameters:
     - thing
    """
    self.send_testStringMap(thing)
    return self.recv_testStringMap()

  def send_testStringMap(self, thing):
    self._oprot.writeMessageBegin('testStringMap', TMessageType.CALL, self._seqid)
    args = testStringMap_args()
    args.thing = thing
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_testStringMap(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = testStringMap_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    raise TApplicationException(TApplicationException.MISSING_RESULT, "testStringMap failed: unknown result");

  def testSet(self, thing):
    """
    Prints 'testSet("{%s}")' where thing has been formatted into a string of  values
     separated by commas and new lines
    @param set<i32> thing - the set<i32> to print
    @return set<i32> - returns the set<i32> 'thing'

    Parameters:
     - thing
    """
    self.send_testSet(thing)
    return self.recv_testSet()

  def send_testSet(self, thing):
    self._oprot.writeMessageBegin('testSet', TMessageType.CALL, self._seqid)
    args = testSet_args()
    args.thing = thing
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_testSet(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = testSet_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    raise TApplicationException(TApplicationException.MISSING_RESULT, "testSet failed: unknown result");

  def testList(self, thing):
    """
    Prints 'testList("{%s}")' where thing has been formatted into a string of  values
     separated by commas and new lines
    @param list<i32> thing - the list<i32> to print
    @return list<i32> - returns the list<i32> 'thing'

    Parameters:
     - thing
    """
    self.send_testList(thing)
    return self.recv_testList()

  def send_testList(self, thing):
    self._oprot.writeMessageBegin('testList', TMessageType.CALL, self._seqid)
    args = testList_args()
    args.thing = thing
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_testList(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = testList_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    raise TApplicationException(TApplicationException.MISSING_RESULT, "testList failed: unknown result");

  def testEnum(self, thing):
    """
    Prints 'testEnum("%d")' where thing has been formatted into it's numeric value
    @param Numberz thing - the Numberz to print
    @return Numberz - returns the Numberz 'thing'

    Parameters:
     - thing
    """
    self.send_testEnum(thing)
    return self.recv_testEnum()

  def send_testEnum(self, thing):
    self._oprot.writeMessageBegin('testEnum', TMessageType.CALL, self._seqid)
    args = testEnum_args()
    args.thing = thing
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_testEnum(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = testEnum_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    raise TApplicationException(TApplicationException.MISSING_RESULT, "testEnum failed: unknown result");

  def testTypedef(self, thing):
    """
    Prints 'testTypedef("%d")' with thing as '%d'
    @param UserId thing - the UserId to print
    @return UserId - returns the UserId 'thing'

    Parameters:
     - thing
    """
    self.send_testTypedef(thing)
    return self.recv_testTypedef()

  def send_testTypedef(self, thing):
    self._oprot.writeMessageBegin('testTypedef', TMessageType.CALL, self._seqid)
    args = testTypedef_args()
    args.thing = thing
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_testTypedef(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = testTypedef_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    raise TApplicationException(TApplicationException.MISSING_RESULT, "testTypedef failed: unknown result");

  def testMapMap(self, hello):
    """
    Prints 'testMapMap("%d")' with hello as '%d'
    @param i32 hello - the i32 to print
    @return map<i32,map<i32,i32>> - returns a dictionary with these values:
      {-4 => {-4 => -4, -3 => -3, -2 => -2, -1 => -1, }, 4 => {1 => 1, 2 => 2, 3 => 3, 4 => 4, }, }

    Parameters:
     - hello
    """
    self.send_testMapMap(hello)
    return self.recv_testMapMap()

  def send_testMapMap(self, hello):
    self._oprot.writeMessageBegin('testMapMap', TMessageType.CALL, self._seqid)
    args = testMapMap_args()
    args.hello = hello
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_testMapMap(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = testMapMap_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    raise TApplicationException(TApplicationException.MISSING_RESULT, "testMapMap failed: unknown result");

  def testInsanity(self, argument):
    """
    So you think you've got this all worked, out eh?

    Creates a the returned map with these values and prints it out:
      { 1 => { 2 => argument,
               3 => argument,
             },
        2 => { 6 => <empty Insanity struct>, },
      }
    @return map<UserId, map<Numberz,Insanity>> - a map with the above values

    Parameters:
     - argument
    """
    self.send_testInsanity(argument)
    return self.recv_testInsanity()

  def send_testInsanity(self, argument):
    self._oprot.writeMessageBegin('testInsanity', TMessageType.CALL, self._seqid)
    args = testInsanity_args()
    args.argument = argument
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_testInsanity(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = testInsanity_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    raise TApplicationException(TApplicationException.MISSING_RESULT, "testInsanity failed: unknown result");

  def testMulti(self, arg0, arg1, arg2, arg3, arg4, arg5):
    """
    Prints 'testMulti()'
    @param byte arg0 -
    @param i32 arg1 -
    @param i64 arg2 -
    @param map<i16, string> arg3 -
    @param Numberz arg4 -
    @param UserId arg5 -
    @return Xtruct - returns an Xtruct with string_thing = "Hello2, byte_thing = arg0, i32_thing = arg1
       and i64_thing = arg2

    Parameters:
     - arg0
     - arg1
     - arg2
     - arg3
     - arg4
     - arg5
    """
    self.send_testMulti(arg0, arg1, arg2, arg3, arg4, arg5)
    return self.recv_testMulti()

  def send_testMulti(self, arg0, arg1, arg2, arg3, arg4, arg5):
    self._oprot.writeMessageBegin('testMulti', TMessageType.CALL, self._seqid)
    args = testMulti_args()
    args.arg0 = arg0
    args.arg1 = arg1
    args.arg2 = arg2
    args.arg3 = arg3
    args.arg4 = arg4
    args.arg5 = arg5
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_testMulti(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = testMulti_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    raise TApplicationException(TApplicationException.MISSING_RESULT, "testMulti failed: unknown result");

  def testException(self, arg):
    """
    Print 'testException(%s)' with arg as '%s'
    @param string arg - a string indication what type of exception to throw
    if arg == "Xception" throw Xception with errorCode = 1001 and message = arg
    elsen if arg == "TException" throw TException
    else do not throw anything

    Parameters:
     - arg
    """
    self.send_testException(arg)
    self.recv_testException()

  def send_testException(self, arg):
    self._oprot.writeMessageBegin('testException', TMessageType.CALL, self._seqid)
    args = testException_args()
    args.arg = arg
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_testException(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = testException_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.err1 is not None:
      raise result.err1
    return

  def testMultiException(self, arg0, arg1):
    """
    Print 'testMultiException(%s, %s)' with arg0 as '%s' and arg1 as '%s'
    @param string arg - a string indication what type of exception to throw
    if arg0 == "Xception" throw Xception with errorCode = 1001 and message = "This is an Xception"
    elsen if arg0 == "Xception2" throw Xception2 with errorCode = 2002 and message = "This is an Xception2"
    else do not throw anything
    @return Xtruct - an Xtruct with string_thing = arg1

    Parameters:
     - arg0
     - arg1
    """
    self.send_testMultiException(arg0, arg1)
    return self.recv_testMultiException()

  def send_testMultiException(self, arg0, arg1):
    self._oprot.writeMessageBegin('testMultiException', TMessageType.CALL, self._seqid)
    args = testMultiException_args()
    args.arg0 = arg0
    args.arg1 = arg1
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_testMultiException(self):
    iprot = self._iprot
    (fname, mtype, rseqid) = iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(iprot)
      iprot.readMessageEnd()
      raise x
    result = testMultiException_result()
    result.read(iprot)
    iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    if result.err1 is not None:
      raise result.err1
    if result.err2 is not None:
      raise result.err2
    raise TApplicationException(TApplicationException.MISSING_RESULT, "testMultiException failed: unknown result");

  def testOneway(self, secondsToSleep):
    """
    Print 'testOneway(%d): Sleeping...' with secondsToSleep as '%d'
    sleep 'secondsToSleep'
    Print 'testOneway(%d): done sleeping!' with secondsToSleep as '%d'
    @param i32 secondsToSleep - the number of seconds to sleep

    Parameters:
     - secondsToSleep
    """
    self.send_testOneway(secondsToSleep)

  def send_testOneway(self, secondsToSleep):
    self._oprot.writeMessageBegin('testOneway', TMessageType.ONEWAY, self._seqid)
    args = testOneway_args()
    args.secondsToSleep = secondsToSleep
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

class Processor(Iface, TProcessor):
  def __init__(self, handler):
    self._handler = handler
    self._processMap = {}
    self._processMap["testVoid"] = Processor.process_testVoid
    self._processMap["testString"] = Processor.process_testString
    self._processMap["testByte"] = Processor.process_testByte
    self._processMap["testI32"] = Processor.process_testI32
    self._processMap["testI64"] = Processor.process_testI64
    self._processMap["testDouble"] = Processor.process_testDouble
    self._processMap["testBinary"] = Processor.process_testBinary
    self._processMap["testStruct"] = Processor.process_testStruct
    self._processMap["testNest"] = Processor.process_testNest
    self._processMap["testMap"] = Processor.process_testMap
    self._processMap["testStringMap"] = Processor.process_testStringMap
    self._processMap["testSet"] = Processor.process_testSet
    self._processMap["testList"] = Processor.process_testList
    self._processMap["testEnum"] = Processor.process_testEnum
    self._processMap["testTypedef"] = Processor.process_testTypedef
    self._processMap["testMapMap"] = Processor.process_testMapMap
    self._processMap["testInsanity"] = Processor.process_testInsanity
    self._processMap["testMulti"] = Processor.process_testMulti
    self._processMap["testException"] = Processor.process_testException
    self._processMap["testMultiException"] = Processor.process_testMultiException
    self._processMap["testOneway"] = Processor.process_testOneway

  def process(self, iprot, oprot):
    (name, type, seqid) = iprot.readMessageBegin()
    if name not in self._processMap:
      iprot.skip(TType.STRUCT)
      iprot.readMessageEnd()
      x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
      oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
      x.write(oprot)
      oprot.writeMessageEnd()
      oprot.trans.flush()
      return
    else:
      self._processMap[name](self, seqid, iprot, oprot)
    return True

  def process_testVoid(self, seqid, iprot, oprot):
    args = testVoid_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = testVoid_result()
    self._handler.testVoid()
    oprot.writeMessageBegin("testVoid", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_testString(self, seqid, iprot, oprot):
    args = testString_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = testString_result()
    result.success = self._handler.testString(args.thing)
    oprot.writeMessageBegin("testString", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_testByte(self, seqid, iprot, oprot):
    args = testByte_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = testByte_result()
    result.success = self._handler.testByte(args.thing)
    oprot.writeMessageBegin("testByte", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_testI32(self, seqid, iprot, oprot):
    args = testI32_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = testI32_result()
    result.success = self._handler.testI32(args.thing)
    oprot.writeMessageBegin("testI32", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_testI64(self, seqid, iprot, oprot):
    args = testI64_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = testI64_result()
    result.success = self._handler.testI64(args.thing)
    oprot.writeMessageBegin("testI64", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_testDouble(self, seqid, iprot, oprot):
    args = testDouble_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = testDouble_result()
    result.success = self._handler.testDouble(args.thing)
    oprot.writeMessageBegin("testDouble", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_testBinary(self, seqid, iprot, oprot):
    args = testBinary_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = testBinary_result()
    result.success = self._handler.testBinary(args.thing)
    oprot.writeMessageBegin("testBinary", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_testStruct(self, seqid, iprot, oprot):
    args = testStruct_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = testStruct_result()
    result.success = self._handler.testStruct(args.thing)
    oprot.writeMessageBegin("testStruct", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_testNest(self, seqid, iprot, oprot):
    args = testNest_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = testNest_result()
    result.success = self._handler.testNest(args.thing)
    oprot.writeMessageBegin("testNest", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_testMap(self, seqid, iprot, oprot):
    args = testMap_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = testMap_result()
    result.success = self._handler.testMap(args.thing)
    oprot.writeMessageBegin("testMap", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_testStringMap(self, seqid, iprot, oprot):
    args = testStringMap_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = testStringMap_result()
    result.success = self._handler.testStringMap(args.thing)
    oprot.writeMessageBegin("testStringMap", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_testSet(self, seqid, iprot, oprot):
    args = testSet_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = testSet_result()
    result.success = self._handler.testSet(args.thing)
    oprot.writeMessageBegin("testSet", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_testList(self, seqid, iprot, oprot):
    args = testList_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = testList_result()
    result.success = self._handler.testList(args.thing)
    oprot.writeMessageBegin("testList", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_testEnum(self, seqid, iprot, oprot):
    args = testEnum_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = testEnum_result()
    result.success = self._handler.testEnum(args.thing)
    oprot.writeMessageBegin("testEnum", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_testTypedef(self, seqid, iprot, oprot):
    args = testTypedef_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = testTypedef_result()
    result.success = self._handler.testTypedef(args.thing)
    oprot.writeMessageBegin("testTypedef", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_testMapMap(self, seqid, iprot, oprot):
    args = testMapMap_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = testMapMap_result()
    result.success = self._handler.testMapMap(args.hello)
    oprot.writeMessageBegin("testMapMap", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_testInsanity(self, seqid, iprot, oprot):
    args = testInsanity_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = testInsanity_result()
    result.success = self._handler.testInsanity(args.argument)
    oprot.writeMessageBegin("testInsanity", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_testMulti(self, seqid, iprot, oprot):
    args = testMulti_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = testMulti_result()
    result.success = self._handler.testMulti(args.arg0, args.arg1, args.arg2, args.arg3, args.arg4, args.arg5)
    oprot.writeMessageBegin("testMulti", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_testException(self, seqid, iprot, oprot):
    args = testException_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = testException_result()
    try:
      self._handler.testException(args.arg)
    except Xception, err1:
      result.err1 = err1
    oprot.writeMessageBegin("testException", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_testMultiException(self, seqid, iprot, oprot):
    args = testMultiException_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = testMultiException_result()
    try:
      result.success = self._handler.testMultiException(args.arg0, args.arg1)
    except Xception, err1:
      result.err1 = err1
    except Xception2, err2:
      result.err2 = err2
    oprot.writeMessageBegin("testMultiException", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_testOneway(self, seqid, iprot, oprot):
    args = testOneway_args()
    args.read(iprot)
    iprot.readMessageEnd()
    self._handler.testOneway(args.secondsToSleep)
    return


# HELPER FUNCTIONS AND STRUCTURES

class testVoid_args(TBase):

  __slots__ = [ 
   ]

  thrift_spec = (
  )

  def __hash__(self):
    value = 17
    return value


class testVoid_result(TBase):

  __slots__ = [ 
   ]

  thrift_spec = (
  )

  def __hash__(self):
    value = 17
    return value


class testString_args(TBase):
  """
  Attributes:
   - thing
  """

  __slots__ = [ 
    'thing',
   ]

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'thing', None, None, ), # 1
  )

  def __init__(self, thing=None,):
    self.thing = thing

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.thing)
    return value


class testString_result(TBase):
  """
  Attributes:
   - success
  """

  __slots__ = [ 
    'success',
   ]

  thrift_spec = (
    (0, TType.STRING, 'success', None, None, ), # 0
  )

  def __init__(self, success=None,):
    self.success = success

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    return value


class testByte_args(TBase):
  """
  Attributes:
   - thing
  """

  __slots__ = [ 
    'thing',
   ]

  thrift_spec = (
    None, # 0
    (1, TType.BYTE, 'thing', None, None, ), # 1
  )

  def __init__(self, thing=None,):
    self.thing = thing

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.thing)
    return value


class testByte_result(TBase):
  """
  Attributes:
   - success
  """

  __slots__ = [ 
    'success',
   ]

  thrift_spec = (
    (0, TType.BYTE, 'success', None, None, ), # 0
  )

  def __init__(self, success=None,):
    self.success = success

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    return value


class testI32_args(TBase):
  """
  Attributes:
   - thing
  """

  __slots__ = [ 
    'thing',
   ]

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'thing', None, None, ), # 1
  )

  def __init__(self, thing=None,):
    self.thing = thing

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.thing)
    return value


class testI32_result(TBase):
  """
  Attributes:
   - success
  """

  __slots__ = [ 
    'success',
   ]

  thrift_spec = (
    (0, TType.I32, 'success', None, None, ), # 0
  )

  def __init__(self, success=None,):
    self.success = success

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    return value


class testI64_args(TBase):
  """
  Attributes:
   - thing
  """

  __slots__ = [ 
    'thing',
   ]

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'thing', None, None, ), # 1
  )

  def __init__(self, thing=None,):
    self.thing = thing

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.thing)
    return value


class testI64_result(TBase):
  """
  Attributes:
   - success
  """

  __slots__ = [ 
    'success',
   ]

  thrift_spec = (
    (0, TType.I64, 'success', None, None, ), # 0
  )

  def __init__(self, success=None,):
    self.success = success

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    return value


class testDouble_args(TBase):
  """
  Attributes:
   - thing
  """

  __slots__ = [ 
    'thing',
   ]

  thrift_spec = (
    None, # 0
    (1, TType.DOUBLE, 'thing', None, None, ), # 1
  )

  def __init__(self, thing=None,):
    self.thing = thing

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.thing)
    return value


class testDouble_result(TBase):
  """
  Attributes:
   - success
  """

  __slots__ = [ 
    'success',
   ]

  thrift_spec = (
    (0, TType.DOUBLE, 'success', None, None, ), # 0
  )

  def __init__(self, success=None,):
    self.success = success

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    return value


class testBinary_args(TBase):
  """
  Attributes:
   - thing
  """

  __slots__ = [ 
    'thing',
   ]

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'thing', None, None, ), # 1
  )

  def __init__(self, thing=None,):
    self.thing = thing

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.thing)
    return value


class testBinary_result(TBase):
  """
  Attributes:
   - success
  """

  __slots__ = [ 
    'success',
   ]

  thrift_spec = (
    (0, TType.STRING, 'success', None, None, ), # 0
  )

  def __init__(self, success=None,):
    self.success = success

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    return value


class testStruct_args(TBase):
  """
  Attributes:
   - thing
  """

  __slots__ = [ 
    'thing',
   ]

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'thing', (Xtruct, Xtruct.thrift_spec), None, ), # 1
  )

  def __init__(self, thing=None,):
    self.thing = thing

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.thing)
    return value


class testStruct_result(TBase):
  """
  Attributes:
   - success
  """

  __slots__ = [ 
    'success',
   ]

  thrift_spec = (
    (0, TType.STRUCT, 'success', (Xtruct, Xtruct.thrift_spec), None, ), # 0
  )

  def __init__(self, success=None,):
    self.success = success

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    return value


class testNest_args(TBase):
  """
  Attributes:
   - thing
  """

  __slots__ = [ 
    'thing',
   ]

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'thing', (Xtruct2, Xtruct2.thrift_spec), None, ), # 1
  )

  def __init__(self, thing=None,):
    self.thing = thing

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.thing)
    return value


class testNest_result(TBase):
  """
  Attributes:
   - success
  """

  __slots__ = [ 
    'success',
   ]

  thrift_spec = (
    (0, TType.STRUCT, 'success', (Xtruct2, Xtruct2.thrift_spec), None, ), # 0
  )

  def __init__(self, success=None,):
    self.success = success

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    return value


class testMap_args(TBase):
  """
  Attributes:
   - thing
  """

  __slots__ = [ 
    'thing',
   ]

  thrift_spec = (
    None, # 0
    (1, TType.MAP, 'thing', (TType.I32,None,TType.I32,None), None, ), # 1
  )

  def __init__(self, thing=None,):
    self.thing = thing

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.thing)
    return value


class testMap_result(TBase):
  """
  Attributes:
   - success
  """

  __slots__ = [ 
    'success',
   ]

  thrift_spec = (
    (0, TType.MAP, 'success', (TType.I32,None,TType.I32,None), None, ), # 0
  )

  def __init__(self, success=None,):
    self.success = success

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    return value


class testStringMap_args(TBase):
  """
  Attributes:
   - thing
  """

  __slots__ = [ 
    'thing',
   ]

  thrift_spec = (
    None, # 0
    (1, TType.MAP, 'thing', (TType.STRING,None,TType.STRING,None), None, ), # 1
  )

  def __init__(self, thing=None,):
    self.thing = thing

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.thing)
    return value


class testStringMap_result(TBase):
  """
  Attributes:
   - success
  """

  __slots__ = [ 
    'success',
   ]

  thrift_spec = (
    (0, TType.MAP, 'success', (TType.STRING,None,TType.STRING,None), None, ), # 0
  )

  def __init__(self, success=None,):
    self.success = success

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    return value


class testSet_args(TBase):
  """
  Attributes:
   - thing
  """

  __slots__ = [ 
    'thing',
   ]

  thrift_spec = (
    None, # 0
    (1, TType.SET, 'thing', (TType.I32,None), None, ), # 1
  )

  def __init__(self, thing=None,):
    self.thing = thing

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.thing)
    return value


class testSet_result(TBase):
  """
  Attributes:
   - success
  """

  __slots__ = [ 
    'success',
   ]

  thrift_spec = (
    (0, TType.SET, 'success', (TType.I32,None), None, ), # 0
  )

  def __init__(self, success=None,):
    self.success = success

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    return value


class testList_args(TBase):
  """
  Attributes:
   - thing
  """

  __slots__ = [ 
    'thing',
   ]

  thrift_spec = (
    None, # 0
    (1, TType.LIST, 'thing', (TType.I32,None), None, ), # 1
  )

  def __init__(self, thing=None,):
    self.thing = thing

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.thing)
    return value


class testList_result(TBase):
  """
  Attributes:
   - success
  """

  __slots__ = [ 
    'success',
   ]

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.I32,None), None, ), # 0
  )

  def __init__(self, success=None,):
    self.success = success

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    return value


class testEnum_args(TBase):
  """
  Attributes:
   - thing
  """

  __slots__ = [ 
    'thing',
   ]

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'thing', None, None, ), # 1
  )

  def __init__(self, thing=None,):
    self.thing = thing

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.thing)
    return value


class testEnum_result(TBase):
  """
  Attributes:
   - success
  """

  __slots__ = [ 
    'success',
   ]

  thrift_spec = (
    (0, TType.I32, 'success', None, None, ), # 0
  )

  def __init__(self, success=None,):
    self.success = success

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    return value


class testTypedef_args(TBase):
  """
  Attributes:
   - thing
  """

  __slots__ = [ 
    'thing',
   ]

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'thing', None, None, ), # 1
  )

  def __init__(self, thing=None,):
    self.thing = thing

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.thing)
    return value


class testTypedef_result(TBase):
  """
  Attributes:
   - success
  """

  __slots__ = [ 
    'success',
   ]

  thrift_spec = (
    (0, TType.I64, 'success', None, None, ), # 0
  )

  def __init__(self, success=None,):
    self.success = success

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    return value


class testMapMap_args(TBase):
  """
  Attributes:
   - hello
  """

  __slots__ = [ 
    'hello',
   ]

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'hello', None, None, ), # 1
  )

  def __init__(self, hello=None,):
    self.hello = hello

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.hello)
    return value


class testMapMap_result(TBase):
  """
  Attributes:
   - success
  """

  __slots__ = [ 
    'success',
   ]

  thrift_spec = (
    (0, TType.MAP, 'success', (TType.I32,None,TType.MAP,(TType.I32,None,TType.I32,None)), None, ), # 0
  )

  def __init__(self, success=None,):
    self.success = success

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    return value


class testInsanity_args(TBase):
  """
  Attributes:
   - argument
  """

  __slots__ = [ 
    'argument',
   ]

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'argument', (Insanity, Insanity.thrift_spec), None, ), # 1
  )

  def __init__(self, argument=None,):
    self.argument = argument

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.argument)
    return value


class testInsanity_result(TBase):
  """
  Attributes:
   - success
  """

  __slots__ = [ 
    'success',
   ]

  thrift_spec = (
    (0, TType.MAP, 'success', (TType.I64,None,TType.MAP,(TType.I32,None,TType.STRUCT,(Insanity, Insanity.thrift_spec))), None, ), # 0
  )

  def __init__(self, success=None,):
    self.success = success

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    return value


class testMulti_args(TBase):
  """
  Attributes:
   - arg0
   - arg1
   - arg2
   - arg3
   - arg4
   - arg5
  """

  __slots__ = [ 
    'arg0',
    'arg1',
    'arg2',
    'arg3',
    'arg4',
    'arg5',
   ]

  thrift_spec = (
    None, # 0
    (1, TType.BYTE, 'arg0', None, None, ), # 1
    (2, TType.I32, 'arg1', None, None, ), # 2
    (3, TType.I64, 'arg2', None, None, ), # 3
    (4, TType.MAP, 'arg3', (TType.I16,None,TType.STRING,None), None, ), # 4
    (5, TType.I32, 'arg4', None, None, ), # 5
    (6, TType.I64, 'arg5', None, None, ), # 6
  )

  def __init__(self, arg0=None, arg1=None, arg2=None, arg3=None, arg4=None, arg5=None,):
    self.arg0 = arg0
    self.arg1 = arg1
    self.arg2 = arg2
    self.arg3 = arg3
    self.arg4 = arg4
    self.arg5 = arg5

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.arg0)
    value = (value * 31) ^ hash(self.arg1)
    value = (value * 31) ^ hash(self.arg2)
    value = (value * 31) ^ hash(self.arg3)
    value = (value * 31) ^ hash(self.arg4)
    value = (value * 31) ^ hash(self.arg5)
    return value


class testMulti_result(TBase):
  """
  Attributes:
   - success
  """

  __slots__ = [ 
    'success',
   ]

  thrift_spec = (
    (0, TType.STRUCT, 'success', (Xtruct, Xtruct.thrift_spec), None, ), # 0
  )

  def __init__(self, success=None,):
    self.success = success

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    return value


class testException_args(TBase):
  """
  Attributes:
   - arg
  """

  __slots__ = [ 
    'arg',
   ]

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'arg', None, None, ), # 1
  )

  def __init__(self, arg=None,):
    self.arg = arg

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.arg)
    return value


class testException_result(TBase):
  """
  Attributes:
   - err1
  """

  __slots__ = [ 
    'err1',
   ]

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'err1', (Xception, Xception.thrift_spec), None, ), # 1
  )

  def __init__(self, err1=None,):
    self.err1 = err1

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.err1)
    return value


class testMultiException_args(TBase):
  """
  Attributes:
   - arg0
   - arg1
  """

  __slots__ = [ 
    'arg0',
    'arg1',
   ]

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'arg0', None, None, ), # 1
    (2, TType.STRING, 'arg1', None, None, ), # 2
  )

  def __init__(self, arg0=None, arg1=None,):
    self.arg0 = arg0
    self.arg1 = arg1

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.arg0)
    value = (value * 31) ^ hash(self.arg1)
    return value


class testMultiException_result(TBase):
  """
  Attributes:
   - success
   - err1
   - err2
  """

  __slots__ = [ 
    'success',
    'err1',
    'err2',
   ]

  thrift_spec = (
    (0, TType.STRUCT, 'success', (Xtruct, Xtruct.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'err1', (Xception, Xception.thrift_spec), None, ), # 1
    (2, TType.STRUCT, 'err2', (Xception2, Xception2.thrift_spec), None, ), # 2
  )

  def __init__(self, success=None, err1=None, err2=None,):
    self.success = success
    self.err1 = err1
    self.err2 = err2

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.success)
    value = (value * 31) ^ hash(self.err1)
    value = (value * 31) ^ hash(self.err2)
    return value


class testOneway_args(TBase):
  """
  Attributes:
   - secondsToSleep
  """

  __slots__ = [ 
    'secondsToSleep',
   ]

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'secondsToSleep', None, None, ), # 1
  )

  def __init__(self, secondsToSleep=None,):
    self.secondsToSleep = secondsToSleep

  def __hash__(self):
    value = 17
    value = (value * 31) ^ hash(self.secondsToSleep)
    return value

