# # Autogenerated by Thrift Compiler (2.4.0-upfluence) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # require 'thrift' require 'srv' require 'debug_proto_test_types' module Inherited SERVICE = 'Inherited'.freeze NAMESPACE = ''.freeze class Client < ::Srv::Client def initialize(client) @client = ::Thrift.build_client(client) end def self.from_provider(provider) Client.new(provider.build(NAMESPACE, SERVICE)) end def identity(arg) result = @client.call_binary( 'identity', Identity_args.new(arg: arg), Identity_result ) return result.success unless result.success.nil? raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'identity failed: unknown result') result end end class Processor < ::Srv::Processor include ::Thrift::Processor def self.from_provider(handler, provider) provider.build(NAMESPACE, SERVICE, Processor, handler) end def process_identity(seqid, iprot, oprot) args = read_args(iprot, Identity_args) result = @middleware.handle_binary('identity', args) do |args| result = Identity_result.new() result.success = @handler.identity(args.arg) result end write_result(result, oprot, 'identity', seqid) end end # HELPER FUNCTIONS AND STRUCTURES class Identity_args include ::Thrift::Struct, ::Thrift::Struct_Union NAME = 'identity_args'.freeze NAMESPACE = ''.freeze THRIFT_FIELD_INDEX_ARG = 1 FIELDS = { THRIFT_FIELD_INDEX_ARG => {type: ::Thrift::Types::I32, name: 'arg'} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self ::Thrift.register_struct_type self end class Identity_result include ::Thrift::Struct, ::Thrift::Struct_Union NAME = 'identity_result'.freeze NAMESPACE = ''.freeze THRIFT_FIELD_INDEX_SUCCESS = 0 FIELDS = { THRIFT_FIELD_INDEX_SUCCESS => {type: ::Thrift::Types::I32, name: 'success'} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self ::Thrift.register_struct_type self end ::Thrift.register_service_type(self) end