Class: Retab::WorkflowArtifacts
- Inherits:
-
Object
- Object
- Retab::WorkflowArtifacts
- Defined in:
- lib/retab/workflow_artifacts.rb
Instance Method Summary collapse
-
#get(artifact_id:, request_options: {}) ⇒ Retab::ExtractionWorkflowArtifact, ...
Get Workflow Artifact By Id.
-
#initialize(client) ⇒ WorkflowArtifacts
constructor
A new instance of WorkflowArtifacts.
-
#list(run_id: nil, operation: nil, block_id: nil, step_id: nil, before: nil, after: nil, limit: 100, request_options: {}) ⇒ Retab::Types::ListStruct<Retab::WorkflowArtifact>
List Workflow Artifacts.
Constructor Details
#initialize(client) ⇒ WorkflowArtifacts
Returns a new instance of WorkflowArtifacts.
9 10 11 |
# File 'lib/retab/workflow_artifacts.rb', line 9 def initialize(client) @client = client end |
Instance Method Details
#get(artifact_id:, request_options: {}) ⇒ Retab::ExtractionWorkflowArtifact, ...
Get Workflow Artifact By Id
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/retab/workflow_artifacts.rb', line 17 def get( artifact_id:, request_options: {} ) response = @client.request( method: :get, path: "/v1/workflows/artifacts/#{Retab::Util.encode_path(artifact_id)}", auth: true, request_options: ) JSON.parse(response.body) end |
#list(run_id: nil, operation: nil, block_id: nil, step_id: nil, before: nil, after: nil, limit: 100, request_options: {}) ⇒ Retab::Types::ListStruct<Retab::WorkflowArtifact>
List Workflow Artifacts
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/retab/workflow_artifacts.rb', line 40 def list( run_id: nil, operation: nil, block_id: nil, step_id: nil, before: nil, after: nil, limit: 100, request_options: {} ) params = { 'run_id' => run_id, 'operation' => operation, 'block_id' => block_id, 'step_id' => step_id, 'before' => before, 'after' => after, 'limit' => limit }.compact response = @client.request( method: :get, path: '/v1/workflows/artifacts', auth: true, params: params, request_options: ) fetch_next = ->(cursor) { list( run_id: run_id, operation: operation, block_id: block_id, step_id: step_id, before: before, after: cursor, limit: limit, request_options: ) } Retab::Types::ListStruct.from_response( response, model: Retab::WorkflowArtifact, filters: { run_id: run_id, operation: operation, block_id: block_id, step_id: step_id, before: before, limit: limit }, fetch_next: fetch_next ) end |