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

require 'thrift'
require 'thrift_test_types'

module Thrift
  module Test
    module ThriftTest
      class Client
        include ::Thrift::Client

        def testVoid()
          send_testVoid()
          recv_testVoid()
        end

        def send_testVoid()
          send_message('testVoid', TestVoid_args)
        end

        def recv_testVoid()
          result = receive_message(TestVoid_result)
          return
        end

        def testString(thing)
          send_testString(thing)
          return recv_testString()
        end

        def send_testString(thing)
          send_message('testString', TestString_args, :thing => thing)
        end

        def recv_testString()
          result = receive_message(TestString_result)
          return result.success unless result.success.nil?
          raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'testString failed: unknown result')
        end

        def testByte(thing)
          send_testByte(thing)
          return recv_testByte()
        end

        def send_testByte(thing)
          send_message('testByte', TestByte_args, :thing => thing)
        end

        def recv_testByte()
          result = receive_message(TestByte_result)
          return result.success unless result.success.nil?
          raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'testByte failed: unknown result')
        end

        def testI32(thing)
          send_testI32(thing)
          return recv_testI32()
        end

        def send_testI32(thing)
          send_message('testI32', TestI32_args, :thing => thing)
        end

        def recv_testI32()
          result = receive_message(TestI32_result)
          return result.success unless result.success.nil?
          raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'testI32 failed: unknown result')
        end

        def testI64(thing)
          send_testI64(thing)
          return recv_testI64()
        end

        def send_testI64(thing)
          send_message('testI64', TestI64_args, :thing => thing)
        end

        def recv_testI64()
          result = receive_message(TestI64_result)
          return result.success unless result.success.nil?
          raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'testI64 failed: unknown result')
        end

        def testDouble(thing)
          send_testDouble(thing)
          return recv_testDouble()
        end

        def send_testDouble(thing)
          send_message('testDouble', TestDouble_args, :thing => thing)
        end

        def recv_testDouble()
          result = receive_message(TestDouble_result)
          return result.success unless result.success.nil?
          raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'testDouble failed: unknown result')
        end

        def testStruct(thing)
          send_testStruct(thing)
          return recv_testStruct()
        end

        def send_testStruct(thing)
          send_message('testStruct', TestStruct_args, :thing => thing)
        end

        def recv_testStruct()
          result = receive_message(TestStruct_result)
          return result.success unless result.success.nil?
          raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'testStruct failed: unknown result')
        end

        def testNest(thing)
          send_testNest(thing)
          return recv_testNest()
        end

        def send_testNest(thing)
          send_message('testNest', TestNest_args, :thing => thing)
        end

        def recv_testNest()
          result = receive_message(TestNest_result)
          return result.success unless result.success.nil?
          raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'testNest failed: unknown result')
        end

        def testMap(thing)
          send_testMap(thing)
          return recv_testMap()
        end

        def send_testMap(thing)
          send_message('testMap', TestMap_args, :thing => thing)
        end

        def recv_testMap()
          result = receive_message(TestMap_result)
          return result.success unless result.success.nil?
          raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'testMap failed: unknown result')
        end

        def testStringMap(thing)
          send_testStringMap(thing)
          return recv_testStringMap()
        end

        def send_testStringMap(thing)
          send_message('testStringMap', TestStringMap_args, :thing => thing)
        end

        def recv_testStringMap()
          result = receive_message(TestStringMap_result)
          return result.success unless result.success.nil?
          raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'testStringMap failed: unknown result')
        end

        def testSet(thing)
          send_testSet(thing)
          return recv_testSet()
        end

        def send_testSet(thing)
          send_message('testSet', TestSet_args, :thing => thing)
        end

        def recv_testSet()
          result = receive_message(TestSet_result)
          return result.success unless result.success.nil?
          raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'testSet failed: unknown result')
        end

        def testList(thing)
          send_testList(thing)
          return recv_testList()
        end

        def send_testList(thing)
          send_message('testList', TestList_args, :thing => thing)
        end

        def recv_testList()
          result = receive_message(TestList_result)
          return result.success unless result.success.nil?
          raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'testList failed: unknown result')
        end

        def testEnum(thing)
          send_testEnum(thing)
          return recv_testEnum()
        end

        def send_testEnum(thing)
          send_message('testEnum', TestEnum_args, :thing => thing)
        end

        def recv_testEnum()
          result = receive_message(TestEnum_result)
          return result.success unless result.success.nil?
          raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'testEnum failed: unknown result')
        end

        def testTypedef(thing)
          send_testTypedef(thing)
          return recv_testTypedef()
        end

        def send_testTypedef(thing)
          send_message('testTypedef', TestTypedef_args, :thing => thing)
        end

        def recv_testTypedef()
          result = receive_message(TestTypedef_result)
          return result.success unless result.success.nil?
          raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'testTypedef failed: unknown result')
        end

        def testMapMap(hello)
          send_testMapMap(hello)
          return recv_testMapMap()
        end

        def send_testMapMap(hello)
          send_message('testMapMap', TestMapMap_args, :hello => hello)
        end

        def recv_testMapMap()
          result = receive_message(TestMapMap_result)
          return result.success unless result.success.nil?
          raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'testMapMap failed: unknown result')
        end

        def testInsanity(argument)
          send_testInsanity(argument)
          return recv_testInsanity()
        end

        def send_testInsanity(argument)
          send_message('testInsanity', TestInsanity_args, :argument => argument)
        end

        def recv_testInsanity()
          result = receive_message(TestInsanity_result)
          return result.success unless result.success.nil?
          raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'testInsanity failed: unknown result')
        end

        def testMulti(arg0, arg1, arg2, arg3, arg4, arg5)
          send_testMulti(arg0, arg1, arg2, arg3, arg4, arg5)
          return recv_testMulti()
        end

        def send_testMulti(arg0, arg1, arg2, arg3, arg4, arg5)
          send_message('testMulti', TestMulti_args, :arg0 => arg0, :arg1 => arg1, :arg2 => arg2, :arg3 => arg3, :arg4 => arg4, :arg5 => arg5)
        end

        def recv_testMulti()
          result = receive_message(TestMulti_result)
          return result.success unless result.success.nil?
          raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'testMulti failed: unknown result')
        end

        def testException(arg)
          send_testException(arg)
          recv_testException()
        end

        def send_testException(arg)
          send_message('testException', TestException_args, :arg => arg)
        end

        def recv_testException()
          result = receive_message(TestException_result)
          raise result.err1 unless result.err1.nil?
          return
        end

        def testMultiException(arg0, arg1)
          send_testMultiException(arg0, arg1)
          return recv_testMultiException()
        end

        def send_testMultiException(arg0, arg1)
          send_message('testMultiException', TestMultiException_args, :arg0 => arg0, :arg1 => arg1)
        end

        def recv_testMultiException()
          result = receive_message(TestMultiException_result)
          return result.success unless result.success.nil?
          raise result.err1 unless result.err1.nil?
          raise result.err2 unless result.err2.nil?
          raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'testMultiException failed: unknown result')
        end

        def testOneway(secondsToSleep)
          send_testOneway(secondsToSleep)
        end

        def send_testOneway(secondsToSleep)
          send_oneway_message('testOneway', TestOneway_args, :secondsToSleep => secondsToSleep)
        end
      end

      class Processor
        include ::Thrift::Processor

        def process_testVoid(seqid, iprot, oprot)
          args = read_args(iprot, TestVoid_args)
          result = TestVoid_result.new()
          @handler.testVoid()
          write_result(result, oprot, 'testVoid', seqid)
        end

        def process_testString(seqid, iprot, oprot)
          args = read_args(iprot, TestString_args)
          result = TestString_result.new()
          result.success = @handler.testString(args.thing)
          write_result(result, oprot, 'testString', seqid)
        end

        def process_testByte(seqid, iprot, oprot)
          args = read_args(iprot, TestByte_args)
          result = TestByte_result.new()
          result.success = @handler.testByte(args.thing)
          write_result(result, oprot, 'testByte', seqid)
        end

        def process_testI32(seqid, iprot, oprot)
          args = read_args(iprot, TestI32_args)
          result = TestI32_result.new()
          result.success = @handler.testI32(args.thing)
          write_result(result, oprot, 'testI32', seqid)
        end

        def process_testI64(seqid, iprot, oprot)
          args = read_args(iprot, TestI64_args)
          result = TestI64_result.new()
          result.success = @handler.testI64(args.thing)
          write_result(result, oprot, 'testI64', seqid)
        end

        def process_testDouble(seqid, iprot, oprot)
          args = read_args(iprot, TestDouble_args)
          result = TestDouble_result.new()
          result.success = @handler.testDouble(args.thing)
          write_result(result, oprot, 'testDouble', seqid)
        end

        def process_testStruct(seqid, iprot, oprot)
          args = read_args(iprot, TestStruct_args)
          result = TestStruct_result.new()
          result.success = @handler.testStruct(args.thing)
          write_result(result, oprot, 'testStruct', seqid)
        end

        def process_testNest(seqid, iprot, oprot)
          args = read_args(iprot, TestNest_args)
          result = TestNest_result.new()
          result.success = @handler.testNest(args.thing)
          write_result(result, oprot, 'testNest', seqid)
        end

        def process_testMap(seqid, iprot, oprot)
          args = read_args(iprot, TestMap_args)
          result = TestMap_result.new()
          result.success = @handler.testMap(args.thing)
          write_result(result, oprot, 'testMap', seqid)
        end

        def process_testStringMap(seqid, iprot, oprot)
          args = read_args(iprot, TestStringMap_args)
          result = TestStringMap_result.new()
          result.success = @handler.testStringMap(args.thing)
          write_result(result, oprot, 'testStringMap', seqid)
        end

        def process_testSet(seqid, iprot, oprot)
          args = read_args(iprot, TestSet_args)
          result = TestSet_result.new()
          result.success = @handler.testSet(args.thing)
          write_result(result, oprot, 'testSet', seqid)
        end

        def process_testList(seqid, iprot, oprot)
          args = read_args(iprot, TestList_args)
          result = TestList_result.new()
          result.success = @handler.testList(args.thing)
          write_result(result, oprot, 'testList', seqid)
        end

        def process_testEnum(seqid, iprot, oprot)
          args = read_args(iprot, TestEnum_args)
          result = TestEnum_result.new()
          result.success = @handler.testEnum(args.thing)
          write_result(result, oprot, 'testEnum', seqid)
        end

        def process_testTypedef(seqid, iprot, oprot)
          args = read_args(iprot, TestTypedef_args)
          result = TestTypedef_result.new()
          result.success = @handler.testTypedef(args.thing)
          write_result(result, oprot, 'testTypedef', seqid)
        end

        def process_testMapMap(seqid, iprot, oprot)
          args = read_args(iprot, TestMapMap_args)
          result = TestMapMap_result.new()
          result.success = @handler.testMapMap(args.hello)
          write_result(result, oprot, 'testMapMap', seqid)
        end

        def process_testInsanity(seqid, iprot, oprot)
          args = read_args(iprot, TestInsanity_args)
          result = TestInsanity_result.new()
          result.success = @handler.testInsanity(args.argument)
          write_result(result, oprot, 'testInsanity', seqid)
        end

        def process_testMulti(seqid, iprot, oprot)
          args = read_args(iprot, TestMulti_args)
          result = TestMulti_result.new()
          result.success = @handler.testMulti(args.arg0, args.arg1, args.arg2, args.arg3, args.arg4, args.arg5)
          write_result(result, oprot, 'testMulti', seqid)
        end

        def process_testException(seqid, iprot, oprot)
          args = read_args(iprot, TestException_args)
          result = TestException_result.new()
          begin
            @handler.testException(args.arg)
          rescue ::Thrift::Test::Xception => err1
            result.err1 = err1
          end
          write_result(result, oprot, 'testException', seqid)
        end

        def process_testMultiException(seqid, iprot, oprot)
          args = read_args(iprot, TestMultiException_args)
          result = TestMultiException_result.new()
          begin
            result.success = @handler.testMultiException(args.arg0, args.arg1)
          rescue ::Thrift::Test::Xception => err1
            result.err1 = err1
          rescue ::Thrift::Test::Xception2 => err2
            result.err2 = err2
          end
          write_result(result, oprot, 'testMultiException', seqid)
        end

        def process_testOneway(seqid, iprot, oprot)
          args = read_args(iprot, TestOneway_args)
          @handler.testOneway(args.secondsToSleep)
          return
        end

      end

      # HELPER FUNCTIONS AND STRUCTURES

      class TestVoid_args
        include ::Thrift::Struct, ::Thrift::Struct_Union

        FIELDS = {

        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestVoid_result
        include ::Thrift::Struct, ::Thrift::Struct_Union

        FIELDS = {

        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestString_args
        include ::Thrift::Struct, ::Thrift::Struct_Union
        THING = 1

        FIELDS = {
          THING => {:type => ::Thrift::Types::STRING, :name => 'thing'}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestString_result
        include ::Thrift::Struct, ::Thrift::Struct_Union
        SUCCESS = 0

        FIELDS = {
          SUCCESS => {:type => ::Thrift::Types::STRING, :name => 'success'}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestByte_args
        include ::Thrift::Struct, ::Thrift::Struct_Union
        THING = 1

        FIELDS = {
          THING => {:type => ::Thrift::Types::BYTE, :name => 'thing'}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestByte_result
        include ::Thrift::Struct, ::Thrift::Struct_Union
        SUCCESS = 0

        FIELDS = {
          SUCCESS => {:type => ::Thrift::Types::BYTE, :name => 'success'}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestI32_args
        include ::Thrift::Struct, ::Thrift::Struct_Union
        THING = 1

        FIELDS = {
          THING => {:type => ::Thrift::Types::I32, :name => 'thing'}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestI32_result
        include ::Thrift::Struct, ::Thrift::Struct_Union
        SUCCESS = 0

        FIELDS = {
          SUCCESS => {:type => ::Thrift::Types::I32, :name => 'success'}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestI64_args
        include ::Thrift::Struct, ::Thrift::Struct_Union
        THING = 1

        FIELDS = {
          THING => {:type => ::Thrift::Types::I64, :name => 'thing'}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestI64_result
        include ::Thrift::Struct, ::Thrift::Struct_Union
        SUCCESS = 0

        FIELDS = {
          SUCCESS => {:type => ::Thrift::Types::I64, :name => 'success'}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestDouble_args
        include ::Thrift::Struct, ::Thrift::Struct_Union
        THING = 1

        FIELDS = {
          THING => {:type => ::Thrift::Types::DOUBLE, :name => 'thing'}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestDouble_result
        include ::Thrift::Struct, ::Thrift::Struct_Union
        SUCCESS = 0

        FIELDS = {
          SUCCESS => {:type => ::Thrift::Types::DOUBLE, :name => 'success'}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestStruct_args
        include ::Thrift::Struct, ::Thrift::Struct_Union
        THING = 1

        FIELDS = {
          THING => {:type => ::Thrift::Types::STRUCT, :name => 'thing', :class => ::Thrift::Test::Xtruct}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestStruct_result
        include ::Thrift::Struct, ::Thrift::Struct_Union
        SUCCESS = 0

        FIELDS = {
          SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Thrift::Test::Xtruct}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestNest_args
        include ::Thrift::Struct, ::Thrift::Struct_Union
        THING = 1

        FIELDS = {
          THING => {:type => ::Thrift::Types::STRUCT, :name => 'thing', :class => ::Thrift::Test::Xtruct2}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestNest_result
        include ::Thrift::Struct, ::Thrift::Struct_Union
        SUCCESS = 0

        FIELDS = {
          SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Thrift::Test::Xtruct2}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestMap_args
        include ::Thrift::Struct, ::Thrift::Struct_Union
        THING = 1

        FIELDS = {
          THING => {:type => ::Thrift::Types::MAP, :name => 'thing', :key => {:type => ::Thrift::Types::I32}, :value => {:type => ::Thrift::Types::I32}}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestMap_result
        include ::Thrift::Struct, ::Thrift::Struct_Union
        SUCCESS = 0

        FIELDS = {
          SUCCESS => {:type => ::Thrift::Types::MAP, :name => 'success', :key => {:type => ::Thrift::Types::I32}, :value => {:type => ::Thrift::Types::I32}}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestStringMap_args
        include ::Thrift::Struct, ::Thrift::Struct_Union
        THING = 1

        FIELDS = {
          THING => {:type => ::Thrift::Types::MAP, :name => 'thing', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestStringMap_result
        include ::Thrift::Struct, ::Thrift::Struct_Union
        SUCCESS = 0

        FIELDS = {
          SUCCESS => {:type => ::Thrift::Types::MAP, :name => 'success', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestSet_args
        include ::Thrift::Struct, ::Thrift::Struct_Union
        THING = 1

        FIELDS = {
          THING => {:type => ::Thrift::Types::SET, :name => 'thing', :element => {:type => ::Thrift::Types::I32}}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestSet_result
        include ::Thrift::Struct, ::Thrift::Struct_Union
        SUCCESS = 0

        FIELDS = {
          SUCCESS => {:type => ::Thrift::Types::SET, :name => 'success', :element => {:type => ::Thrift::Types::I32}}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestList_args
        include ::Thrift::Struct, ::Thrift::Struct_Union
        THING = 1

        FIELDS = {
          THING => {:type => ::Thrift::Types::LIST, :name => 'thing', :element => {:type => ::Thrift::Types::I32}}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestList_result
        include ::Thrift::Struct, ::Thrift::Struct_Union
        SUCCESS = 0

        FIELDS = {
          SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::I32}}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestEnum_args
        include ::Thrift::Struct, ::Thrift::Struct_Union
        THING = 1

        FIELDS = {
          THING => {:type => ::Thrift::Types::I32, :name => 'thing', :enum_class => ::Thrift::Test::Numberz}
        }

        def struct_fields; FIELDS; end

        def validate
          unless @thing.nil? || ::Thrift::Test::Numberz::VALID_VALUES.include?(@thing)
            raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field thing!')
          end
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestEnum_result
        include ::Thrift::Struct, ::Thrift::Struct_Union
        SUCCESS = 0

        FIELDS = {
          SUCCESS => {:type => ::Thrift::Types::I32, :name => 'success', :enum_class => ::Thrift::Test::Numberz}
        }

        def struct_fields; FIELDS; end

        def validate
          unless @success.nil? || ::Thrift::Test::Numberz::VALID_VALUES.include?(@success)
            raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field success!')
          end
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestTypedef_args
        include ::Thrift::Struct, ::Thrift::Struct_Union
        THING = 1

        FIELDS = {
          THING => {:type => ::Thrift::Types::I64, :name => 'thing'}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestTypedef_result
        include ::Thrift::Struct, ::Thrift::Struct_Union
        SUCCESS = 0

        FIELDS = {
          SUCCESS => {:type => ::Thrift::Types::I64, :name => 'success'}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestMapMap_args
        include ::Thrift::Struct, ::Thrift::Struct_Union
        HELLO = 1

        FIELDS = {
          HELLO => {:type => ::Thrift::Types::I32, :name => 'hello'}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestMapMap_result
        include ::Thrift::Struct, ::Thrift::Struct_Union
        SUCCESS = 0

        FIELDS = {
          SUCCESS => {:type => ::Thrift::Types::MAP, :name => 'success', :key => {:type => ::Thrift::Types::I32}, :value => {:type => ::Thrift::Types::MAP, :key => {:type => ::Thrift::Types::I32}, :value => {:type => ::Thrift::Types::I32}}}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestInsanity_args
        include ::Thrift::Struct, ::Thrift::Struct_Union
        ARGUMENT = 1

        FIELDS = {
          ARGUMENT => {:type => ::Thrift::Types::STRUCT, :name => 'argument', :class => ::Thrift::Test::Insanity}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestInsanity_result
        include ::Thrift::Struct, ::Thrift::Struct_Union
        SUCCESS = 0

        FIELDS = {
          SUCCESS => {:type => ::Thrift::Types::MAP, :name => 'success', :key => {:type => ::Thrift::Types::I64}, :value => {:type => ::Thrift::Types::MAP, :key => {:type => ::Thrift::Types::I32, :enum_class => ::Thrift::Test::Numberz}, :value => {:type => ::Thrift::Types::STRUCT, :class => ::Thrift::Test::Insanity}}}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestMulti_args
        include ::Thrift::Struct, ::Thrift::Struct_Union
        ARG0 = 1
        ARG1 = 2
        ARG2 = 3
        ARG3 = 4
        ARG4 = 5
        ARG5 = 6

        FIELDS = {
          ARG0 => {:type => ::Thrift::Types::BYTE, :name => 'arg0'},
          ARG1 => {:type => ::Thrift::Types::I32, :name => 'arg1'},
          ARG2 => {:type => ::Thrift::Types::I64, :name => 'arg2'},
          ARG3 => {:type => ::Thrift::Types::MAP, :name => 'arg3', :key => {:type => ::Thrift::Types::I16}, :value => {:type => ::Thrift::Types::STRING}},
          ARG4 => {:type => ::Thrift::Types::I32, :name => 'arg4', :enum_class => ::Thrift::Test::Numberz},
          ARG5 => {:type => ::Thrift::Types::I64, :name => 'arg5'}
        }

        def struct_fields; FIELDS; end

        def validate
          unless @arg4.nil? || ::Thrift::Test::Numberz::VALID_VALUES.include?(@arg4)
            raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field arg4!')
          end
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestMulti_result
        include ::Thrift::Struct, ::Thrift::Struct_Union
        SUCCESS = 0

        FIELDS = {
          SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Thrift::Test::Xtruct}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestException_args
        include ::Thrift::Struct, ::Thrift::Struct_Union
        ARG = 1

        FIELDS = {
          ARG => {:type => ::Thrift::Types::STRING, :name => 'arg'}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestException_result
        include ::Thrift::Struct, ::Thrift::Struct_Union
        ERR1 = 1

        FIELDS = {
          ERR1 => {:type => ::Thrift::Types::STRUCT, :name => 'err1', :class => ::Thrift::Test::Xception}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestMultiException_args
        include ::Thrift::Struct, ::Thrift::Struct_Union
        ARG0 = 1
        ARG1 = 2

        FIELDS = {
          ARG0 => {:type => ::Thrift::Types::STRING, :name => 'arg0'},
          ARG1 => {:type => ::Thrift::Types::STRING, :name => 'arg1'}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestMultiException_result
        include ::Thrift::Struct, ::Thrift::Struct_Union
        SUCCESS = 0
        ERR1 = 1
        ERR2 = 2

        FIELDS = {
          SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::Thrift::Test::Xtruct},
          ERR1 => {:type => ::Thrift::Types::STRUCT, :name => 'err1', :class => ::Thrift::Test::Xception},
          ERR2 => {:type => ::Thrift::Types::STRUCT, :name => 'err2', :class => ::Thrift::Test::Xception2}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestOneway_args
        include ::Thrift::Struct, ::Thrift::Struct_Union
        SECONDSTOSLEEP = 1

        FIELDS = {
          SECONDSTOSLEEP => {:type => ::Thrift::Types::I32, :name => 'secondsToSleep'}
        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class TestOneway_result
        include ::Thrift::Struct, ::Thrift::Struct_Union

        FIELDS = {

        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

    end

  end
end
