Class: Exa::Resources::Import

Inherits:
Struct
  • Object
show all
Defined in:
lib/exa/resources/import.rb

Overview

Represents an import operation for bringing external data into Exa

An import allows uploading CSV data containing entities (e.g., companies) to be processed and enriched within the Exa system.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, object:, status:, format: nil, entity: nil, title: nil, count: nil, metadata: nil, failed_reason: nil, failed_at: nil, failed_message: nil, created_at: nil, updated_at: nil, upload_url: nil, upload_valid_until: nil) ⇒ Import

Returns a new instance of Import.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/exa/resources/import.rb', line 27

def initialize(
  id:,
  object:,
  status:,
  format: nil,
  entity: nil,
  title: nil,
  count: nil,
  metadata: nil,
  failed_reason: nil,
  failed_at: nil,
  failed_message: nil,
  created_at: nil,
  updated_at: nil,
  upload_url: nil,
  upload_valid_until: nil
)
  super
  freeze
end

Instance Attribute Details

#countObject

Returns the value of attribute count

Returns:

  • (Object)

    the current value of count



9
10
11
# File 'lib/exa/resources/import.rb', line 9

def count
  @count
end

#created_atObject

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



9
10
11
# File 'lib/exa/resources/import.rb', line 9

def created_at
  @created_at
end

#entityObject

Returns the value of attribute entity

Returns:

  • (Object)

    the current value of entity



9
10
11
# File 'lib/exa/resources/import.rb', line 9

def entity
  @entity
end

#failed_atObject

Returns the value of attribute failed_at

Returns:

  • (Object)

    the current value of failed_at



9
10
11
# File 'lib/exa/resources/import.rb', line 9

def failed_at
  @failed_at
end

#failed_messageObject

Returns the value of attribute failed_message

Returns:

  • (Object)

    the current value of failed_message



9
10
11
# File 'lib/exa/resources/import.rb', line 9

def failed_message
  @failed_message
end

#failed_reasonObject

Returns the value of attribute failed_reason

Returns:

  • (Object)

    the current value of failed_reason



9
10
11
# File 'lib/exa/resources/import.rb', line 9

def failed_reason
  @failed_reason
end

#formatObject

Returns the value of attribute format

Returns:

  • (Object)

    the current value of format



9
10
11
# File 'lib/exa/resources/import.rb', line 9

def format
  @format
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



9
10
11
# File 'lib/exa/resources/import.rb', line 9

def id
  @id
end

#metadataObject

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



9
10
11
# File 'lib/exa/resources/import.rb', line 9

def 
  
end

#objectObject

Returns the value of attribute object

Returns:

  • (Object)

    the current value of object



9
10
11
# File 'lib/exa/resources/import.rb', line 9

def object
  @object
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



9
10
11
# File 'lib/exa/resources/import.rb', line 9

def status
  @status
end

#titleObject

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



9
10
11
# File 'lib/exa/resources/import.rb', line 9

def title
  @title
end

#updated_atObject

Returns the value of attribute updated_at

Returns:

  • (Object)

    the current value of updated_at



9
10
11
# File 'lib/exa/resources/import.rb', line 9

def updated_at
  @updated_at
end

#upload_urlObject

Returns the value of attribute upload_url

Returns:

  • (Object)

    the current value of upload_url



9
10
11
# File 'lib/exa/resources/import.rb', line 9

def upload_url
  @upload_url
end

#upload_valid_untilObject

Returns the value of attribute upload_valid_until

Returns:

  • (Object)

    the current value of upload_valid_until



9
10
11
# File 'lib/exa/resources/import.rb', line 9

def upload_valid_until
  @upload_valid_until
end

Instance Method Details

#completed?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/exa/resources/import.rb', line 57

def completed?
  status == "completed"
end

#failed?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/exa/resources/import.rb', line 61

def failed?
  status == "failed"
end

#pending?Boolean

Status helper methods

Returns:

  • (Boolean)


49
50
51
# File 'lib/exa/resources/import.rb', line 49

def pending?
  status == "pending"
end

#processing?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/exa/resources/import.rb', line 53

def processing?
  status == "processing"
end

#to_hObject



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/exa/resources/import.rb', line 65

def to_h
  {
    id: id,
    object: object,
    status: status,
    format: format,
    entity: entity,
    title: title,
    count: count,
    metadata: ,
    failed_reason: failed_reason,
    failed_at: failed_at,
    failed_message: failed_message,
    created_at: created_at,
    updated_at: updated_at,
    upload_url: upload_url,
    upload_valid_until: upload_valid_until
  }.compact
end