Class: Retab::WorkflowBlockExecutions
- Inherits:
-
Object
- Object
- Retab::WorkflowBlockExecutions
- Defined in:
- lib/retab/workflow_block_executions.rb
Instance Method Summary collapse
-
#create(run_id:, block_id:, step_id: nil, n_consensus: nil, check_eligibility: nil, request_options: {}) ⇒ Retab::StoredBlockExecution
Create Block Execution.
-
#initialize(client) ⇒ WorkflowBlockExecutions
constructor
A new instance of WorkflowBlockExecutions.
-
#list(run_id:, block_id:, before: nil, after: nil, limit: 20, order: "desc", request_options: {}) ⇒ Retab::PaginatedList<Retab::StoredBlockExecution>
List Block Executions.
Constructor Details
#initialize(client) ⇒ WorkflowBlockExecutions
Returns a new instance of WorkflowBlockExecutions.
9 10 11 |
# File 'lib/retab/workflow_block_executions.rb', line 9 def initialize(client) @client = client end |
Instance Method Details
#create(run_id:, block_id:, step_id: nil, n_consensus: nil, check_eligibility: nil, request_options: {}) ⇒ Retab::StoredBlockExecution
Create Block Execution
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/retab/workflow_block_executions.rb', line 73 def create( run_id:, block_id:, step_id: nil, n_consensus: nil, check_eligibility: nil, request_options: {} ) body = { "run_id" => run_id, "block_id" => block_id, "step_id" => step_id, "n_consensus" => n_consensus, "check_eligibility" => check_eligibility }.compact response = @client.request( method: :post, path: "/v1/workflows/blocks/executions", auth: true, body: body, request_options: ) result = Retab::StoredBlockExecution.new(response.body) result.last_response = Retab::Types::ApiResponse.new( http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"] ) result end |
#list(run_id:, block_id:, before: nil, after: nil, limit: 20, order: "desc", request_options: {}) ⇒ Retab::PaginatedList<Retab::StoredBlockExecution>
List Block Executions
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/retab/workflow_block_executions.rb', line 22 def list( run_id:, block_id:, before: nil, after: nil, limit: 20, order: "desc", request_options: {} ) params = { "run_id" => run_id, "block_id" => block_id, "before" => before, "after" => after, "limit" => limit, "order" => order }.compact response = @client.request( method: :get, path: "/v1/workflows/blocks/executions", auth: true, params: params, request_options: ) fetch_next = -> (cursor) { list( run_id: run_id, block_id: block_id, before: before, after: cursor, limit: limit, order: order, request_options: ) } Retab::PaginatedList.from_response( response, model: Retab::StoredBlockExecution, filters: {run_id: run_id, block_id: block_id, before: before, limit: limit, order: order}, fetch_next: fetch_next ) end |