Class: Mindee::V2::Parsing::FailedInferenceResponse

Inherits:
CommonResponse show all
Defined in:
lib/mindee/v2/parsing/failed_inference_response.rb

Overview

"Webhook payload returned when an inference fails before producing a result.

Instance Attribute Summary collapse

Attributes inherited from CommonResponse

#raw_http

Instance Method Summary collapse

Constructor Details

#initialize(server_response) ⇒ FailedInferenceResponse

Returns a new instance of FailedInferenceResponse.



21
22
23
24
25
26
27
28
29
30
# File 'lib/mindee/v2/parsing/failed_inference_response.rb', line 21

def initialize(server_response)
  super

  @inference_id = server_response['inference_id']
  @model_id = server_response['model_id']
  @file_name = server_response['file_name']
  @file_alias = server_response['file_alias']
  @error = ErrorResponse.new(server_response['error'])
  @created_at = Time.iso8601(server_response['created_at'])
end

Instance Attribute Details

#created_atTime (readonly)

Returns Date and time when the inference was started.

Returns:

  • (Time)

    Date and time when the inference was started.



19
20
21
# File 'lib/mindee/v2/parsing/failed_inference_response.rb', line 19

def created_at
  @created_at
end

#errorMindee::V2::Parsing::ErrorResponse (readonly)

Returns Problem details for the failure, if available.

Returns:



17
18
19
# File 'lib/mindee/v2/parsing/failed_inference_response.rb', line 17

def error
  @error
end

#file_aliasString, Nil (readonly)

Returns Alias sent for the file, if any.

Returns:

  • (String, Nil)

    Alias sent for the file, if any.



15
16
17
# File 'lib/mindee/v2/parsing/failed_inference_response.rb', line 15

def file_alias
  @file_alias
end

#file_nameString (readonly)

Returns Name of the input file.

Returns:

  • (String)

    Name of the input file.



13
14
15
# File 'lib/mindee/v2/parsing/failed_inference_response.rb', line 13

def file_name
  @file_name
end

#inference_idString (readonly)

Returns UUID of the failed inference.

Returns:

  • (String)

    UUID of the failed inference.



9
10
11
# File 'lib/mindee/v2/parsing/failed_inference_response.rb', line 9

def inference_id
  @inference_id
end

#model_idString (readonly)

Returns UUID of the model used.

Returns:

  • (String)

    UUID of the model used.



11
12
13
# File 'lib/mindee/v2/parsing/failed_inference_response.rb', line 11

def model_id
  @model_id
end