Class: Retab::WorkflowSpec
- Inherits:
-
Object
- Object
- Retab::WorkflowSpec
- Defined in:
- lib/retab/workflow_spec.rb
Instance Method Summary collapse
-
#apply(yaml_definition:, request_options: {}) ⇒ Retab::DeclarativeApplyResponse
Apply Workflow Spec.
-
#get(workflow_id:, request_options: {}) ⇒ Retab::DeclarativeExportResponse
Export Workflow Spec.
-
#initialize(client) ⇒ WorkflowSpec
constructor
A new instance of WorkflowSpec.
-
#plan(yaml_definition:, request_options: {}) ⇒ Retab::DeclarativePlanResponse
Plan Workflow Spec.
-
#validate(yaml_definition:, request_options: {}) ⇒ Retab::DeclarativeValidationResponse
Validate Workflow Spec.
Constructor Details
#initialize(client) ⇒ WorkflowSpec
Returns a new instance of WorkflowSpec.
9 10 11 |
# File 'lib/retab/workflow_spec.rb', line 9 def initialize(client) @client = client end |
Instance Method Details
#apply(yaml_definition:, request_options: {}) ⇒ Retab::DeclarativeApplyResponse
Apply Workflow Spec
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/retab/workflow_spec.rb', line 71 def apply( yaml_definition:, request_options: {} ) body = { "yaml_definition" => yaml_definition } response = @client.request( method: :post, path: "/v1/workflows/spec/apply", auth: true, body: body, request_options: ) result = Retab::DeclarativeApplyResponse.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 |
#get(workflow_id:, request_options: {}) ⇒ Retab::DeclarativeExportResponse
Export Workflow Spec
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/retab/workflow_spec.rb', line 98 def get( workflow_id:, request_options: {} ) response = @client.request( method: :get, path: "/v1/workflows/spec/#{Retab::Util.encode_path(workflow_id)}", auth: true, request_options: ) result = Retab::DeclarativeExportResponse.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 |
#plan(yaml_definition:, request_options: {}) ⇒ Retab::DeclarativePlanResponse
Plan Workflow Spec
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/retab/workflow_spec.rb', line 44 def plan( yaml_definition:, request_options: {} ) body = { "yaml_definition" => yaml_definition } response = @client.request( method: :post, path: "/v1/workflows/spec/plan", auth: true, body: body, request_options: ) result = Retab::DeclarativePlanResponse.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 |
#validate(yaml_definition:, request_options: {}) ⇒ Retab::DeclarativeValidationResponse
Validate Workflow Spec
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/retab/workflow_spec.rb', line 17 def validate( yaml_definition:, request_options: {} ) body = { "yaml_definition" => yaml_definition } response = @client.request( method: :post, path: "/v1/workflows/spec/validate", auth: true, body: body, request_options: ) result = Retab::DeclarativeValidationResponse.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 |