Sha256: 1bf17b55026b9501c00ec80fb023b7b0b1b6e5b9c37a7515eb7fd2256ddd36af

Contents?: true

Size: 819 Bytes

Versions: 5

Compression:

Stored size: 819 Bytes

Contents

module MistralClient
  class ActionExecution < Base
    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

    include MistralClient::Mixins::MistralObject

    def initialize(server, id: nil)
      @server = server
      @path = 'action_executions'
      @id = id
      reload if @id
    end

    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
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mistral_client-1.3.0 lib/mistral_client/action_execution.rb
mistral_client-1.2.1 lib/mistral_client/action_execution.rb
mistral_client-1.2.0 lib/mistral_client/action_execution.rb
mistral_client-1.1.0 lib/mistral_client/action_execution.rb
mistral_client-1.0.0 lib/mistral_client/action_execution.rb