#
# 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 SecondService
      class Client
        include ::Thrift::Client

        def blahBlah()
          send_blahBlah()
          recv_blahBlah()
        end

        def send_blahBlah()
          send_message('blahBlah', BlahBlah_args)
        end

        def recv_blahBlah()
          result = receive_message(BlahBlah_result)
          return
        end

        def secondtestString(thing)
          send_secondtestString(thing)
          return recv_secondtestString()
        end

        def send_secondtestString(thing)
          send_message('secondtestString', SecondtestString_args, :thing => thing)
        end

        def recv_secondtestString()
          result = receive_message(SecondtestString_result)
          return result.success unless result.success.nil?
          raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'secondtestString failed: unknown result')
        end

      end

      class Processor
        include ::Thrift::Processor

        def process_blahBlah(seqid, iprot, oprot)
          args = read_args(iprot, BlahBlah_args)
          result = BlahBlah_result.new()
          @handler.blahBlah()
          write_result(result, oprot, 'blahBlah', seqid)
        end

        def process_secondtestString(seqid, iprot, oprot)
          args = read_args(iprot, SecondtestString_args)
          result = SecondtestString_result.new()
          result.success = @handler.secondtestString(args.thing)
          write_result(result, oprot, 'secondtestString', seqid)
        end

      end

      # HELPER FUNCTIONS AND STRUCTURES

      class BlahBlah_args
        include ::Thrift::Struct, ::Thrift::Struct_Union

        FIELDS = {

        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class BlahBlah_result
        include ::Thrift::Struct, ::Thrift::Struct_Union

        FIELDS = {

        }

        def struct_fields; FIELDS; end

        def validate
        end

        ::Thrift::Struct.generate_accessors self
      end

      class SecondtestString_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 SecondtestString_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

    end

  end
end
