module O3P include Message::ORiN3::Provider::V1::AutoGenerated end module O3 include Design::ORiN3::Common::V1::AutoGenerated include Message::ORiN3::Provider::V1::AutoGenerated::ResourceOpener end module Grpc module Client module ORiN3 module Provider module ORiN3ResourceOpener def open(argument = nil) argument = argument.nil? ? {} : argument begin resource_opener = O3::ResourceOpenerService::Stub.new(nil, :this_channel_is_insecure, channel_override: @channel) request = O3::OpenRequest.new(common: O3P::CommonRequest.new, id: @internal_id, argument: ORiN3BinaryConverter.from_dictionary_to_binary(argument)) response = resource_opener.open(request) if (response.common.result_code != :SUCCEEDED) raise MessageClientError.new(response.common.result_code, response.common.detail) end rescue MessageClientError => ee raise rescue StandardError => e raise MessageClientError.new(e) end end def close(argument = nil) argument = argument.nil? ? {} : argument begin resource_opener = O3::ResourceOpenerService::Stub.new(nil, :this_channel_is_insecure, channel_override: @channel) request = O3::CloseRequest.new(common: O3P::CommonRequest.new, id: @internal_id, argument: ORiN3BinaryConverter.from_dictionary_to_binary(argument)) response = resource_opener.close(request) if (response.common.result_code != :SUCCEEDED) raise MessageClientError.new(response.common.result_code, response.common.detail) end rescue MessageClientError raise rescue StandardError => e raise MessageClientError.new(e) end end end end end end end