Class: Ecoportal::API::GraphQL::FileUpload::Client::Result

Inherits:
Struct
  • Object
show all
Defined in:
lib/ecoportal/api/graphql/file_upload/client.rb

Overview

One entry per input file. Mirrors ecoportal-api-v2's S3::Files::BatchUpload::FileResult so batch code reads the same in both stacks.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#errorObject

Returns the value of attribute error.



61
62
63
# File 'lib/ecoportal/api/graphql/file_upload/client.rb', line 61

def error
  @error
end

#fileObject

Returns the value of attribute file

Returns:

  • (Object)

    the current value of file



60
61
62
# File 'lib/ecoportal/api/graphql/file_upload/client.rb', line 60

def file
  @file
end

#keyObject

Returns the value of attribute key.



61
62
63
# File 'lib/ecoportal/api/graphql/file_upload/client.rb', line 61

def key
  @key
end

#payloadObject

Returns the value of attribute payload.



61
62
63
# File 'lib/ecoportal/api/graphql/file_upload/client.rb', line 61

def payload
  @payload
end

Instance Method Details

#container_idObject



75
76
77
# File 'lib/ecoportal/api/graphql/file_upload/client.rb', line 75

def container_id
  file_container&.id
end

#error?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/ecoportal/api/graphql/file_upload/client.rb', line 63

def error?
  !error.nil?
end

#file_containerObject



71
72
73
# File 'lib/ecoportal/api/graphql/file_upload/client.rb', line 71

def file_container
  payload&.item
end

#success?Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/ecoportal/api/graphql/file_upload/client.rb', line 67

def success?
  !error? && !container_id.nil?
end