Class: MistralClient::ActionExecution
- Includes:
- Mixins::MistralObject
- Defined in:
- lib/mistral_client/action_execution.rb
Constant Summary collapse
- UNICODE_FIELDS =
%w[ description name state state_info task_execution_id task_name workflow_name ].freeze
- JSON_FIELDS =
%w[input output params].freeze
- BOOL_FIELDS =
%w[accepted].freeze
- PATH =
'action_executions'.freeze
Constants inherited from Base
Instance Method Summary collapse
-
#initialize(server, id: nil) ⇒ ActionExecution
constructor
A new instance of ActionExecution.
- #patch(state: nil, output: nil) ⇒ Object
Methods included from Mixins::MistralObject
included, #ivars_from_response, #list, #reload
Constructor Details
#initialize(server, id: nil) ⇒ ActionExecution
Returns a new instance of ActionExecution.
20 21 22 23 24 25 26 |
# File 'lib/mistral_client/action_execution.rb', line 20 def initialize(server, id: nil) super() @server = server @path = 'action_executions' @id = id reload if @id end |
Instance Method Details
#patch(state: nil, output: nil) ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/mistral_client/action_execution.rb', line 28 def patch(state: nil, output: nil) body = {} body[:state] = state unless state.nil? body[:output] = output unless output.nil? return if body.empty? resp = @server.put("#{PATH}/#{@id}", body.to_json, json: true) ivars_from_response(resp) end |