Class: Mindee::Parsing::Common::WorkflowResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/mindee/parsing/common/api_response.rb

Overview

Represents the server response after a document is sent to a workflow.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(product_class, http_response, raw_http) ⇒ WorkflowResponse

Returns a new instance of WorkflowResponse.

Parameters:

  • http_response (Hash)
  • product_class (Mindee::Inference)


138
139
140
141
142
143
# File 'lib/mindee/parsing/common/api_response.rb', line 138

def initialize(product_class, http_response, raw_http)
  @raw_http = raw_http.to_s
  @api_request = Mindee::Parsing::Common::ApiRequest.new(http_response['api_request'])
  product_class = (product_class || Product::Generated::GeneratedV1)
  @execution = Mindee::Parsing::Common::Execution.new(product_class, http_response['execution'])
end

Instance Attribute Details

#api_requestMindee::Parsing::Common::ApiRequest (readonly)



132
133
134
# File 'lib/mindee/parsing/common/api_response.rb', line 132

def api_request
  @api_request
end

#executionMindee::Parsing::Common::Execution (readonly)

Set the prediction model used to parse the document. The response object will be instantiated based on this parameter.



130
131
132
# File 'lib/mindee/parsing/common/api_response.rb', line 130

def execution
  @execution
end

#raw_httpString (readonly)

Returns:

  • (String)


134
135
136
# File 'lib/mindee/parsing/common/api_response.rb', line 134

def raw_http
  @raw_http
end