require_relative '../../../../../gen/Design.ORiN3.Common/V1/orin3_common_pb' require_relative '../../../../../gen/Message.ORiN3.Provider/V1/orin3_resource_opener_pb' require_relative '../../../../../gen/Message.ORiN3.Provider/V1/orin3_resource_opener_services_pb' require_relative '../message_client_error' require_relative '../../../orin3/provider/orin3_binary_converter' 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 ORiN3ChildCreator def create_variable(name, type_name, option, value_type) begin controller = O3::ChildCreatorService::Stub.new(nil, :this_channel_is_insecure, channel_override: @channel) request = O3::CreateVariableRequest.new(common: O3P::CommonRequest.new, parent_id: @internal_id, name: name, type_name: type_name, option: option, value_type: value_type) response = controller.create_variable(request) if (response.common.result_code != :SUCCEEDED) raise MessageClientError.new(response.common.result_code, response.common.detail) end return ORiN3Variable.new(@channel, response.variable_id, response.created_datetime, value_type) rescue MessageClientError raise rescue StandardError => e raise MessageClientError.new(e) end end def create_job(name, type_name, option) begin controller = O3::ChildCreatorService::Stub.new(nil, :this_channel_is_insecure, channel_override: @channel) request = O3::CreateJobRequest.new(common: O3P::CommonRequest.new, parent_id: @internal_id, name: name, type_name: type_name, option: option) response = controller.create_job(request) if (response.common.result_code != :SUCCEEDED) raise MessageClientError.new(response.common.result_code, response.common.detail) end return ORiN3Job.new(@channel, response.job_id, response.created_datetime) rescue MessageClientError raise rescue StandardError => e raise MessageClientError.new(e) end end def create_file(name, type_name, option) begin controller = O3::ChildCreatorService::Stub.new(nil, :this_channel_is_insecure, channel_override: @channel) request = O3::CreateFileRequest.new(common: O3P::CommonRequest.new, parent_id: @internal_id, name: name, type_name: type_name, option: option) response = controller.create_file(request) if (response.common.result_code != :SUCCEEDED) raise MessageClientError.new(response.common.result_code, response.common.detail) end return ORiN3File.new(@channel, response.file_id, response.created_datetime) rescue MessageClientError raise rescue StandardError => e raise MessageClientError.new(e) end end def create_stream(name, type_name, option) begin controller = O3::ChildCreatorService::Stub.new(nil, :this_channel_is_insecure, channel_override: @channel) request = O3::CreateStreamRequest.new(common: O3P::CommonRequest.new, parent_id: @internal_id, name: name, type_name: type_name, option: option) response = controller.create_stream(request) if (response.common.result_code != :SUCCEEDED) raise MessageClientError.new(response.common.result_code, response.common.detail) end return ORiN3Stream.new(@channel, response.stream_id, response.created_datetime) rescue MessageClientError raise rescue StandardError => e raise MessageClientError.new(e) end end def create_module(name, type_name, option) begin controller = O3::ChildCreatorService::Stub.new(nil, :this_channel_is_insecure, channel_override: @channel) request = O3::CreateModuleRequest.new(common: O3P::CommonRequest.new, parent_id: @internal_id, name: name, type_name: type_name, option: option) response = controller.create_module(request) if (response.common.result_code != :SUCCEEDED) raise MessageClientError.new(response.common.result_code, response.common.detail) end return ORiN3Module.new(@channel, response.module_id, response.created_datetime) rescue MessageClientError raise rescue StandardError => e raise MessageClientError.new(e) end end end end end end end