Class: Exa::Resources::WebsetSearch

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

Overview

Represents a search operation within a webset

A search finds entities matching specific criteria and can either override existing webset items or append to them.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, object:, status:, webset_id: nil, query: nil, entity: nil, criteria: nil, count: nil, behavior: nil, exclude: nil, scope: nil, progress: nil, recall: nil, metadata: nil, canceled_at: nil, canceled_reason: nil, created_at: nil, updated_at: nil) ⇒ WebsetSearch

Returns a new instance of WebsetSearch.



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/exa/resources/webset_search.rb', line 30

def initialize(
  id:,
  object:,
  status:,
  webset_id: nil,
  query: nil,
  entity: nil,
  criteria: nil,
  count: nil,
  behavior: nil,
  exclude: nil,
  scope: nil,
  progress: nil,
  recall: nil,
  metadata: nil,
  canceled_at: nil,
  canceled_reason: nil,
  created_at: nil,
  updated_at: nil
)
  super
  freeze
end

Instance Attribute Details

#behaviorObject

Returns the value of attribute behavior

Returns:

  • (Object)

    the current value of behavior



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

def behavior
  @behavior
end

#canceled_atObject

Returns the value of attribute canceled_at

Returns:

  • (Object)

    the current value of canceled_at



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

def canceled_at
  @canceled_at
end

#canceled_reasonObject

Returns the value of attribute canceled_reason

Returns:

  • (Object)

    the current value of canceled_reason



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

def canceled_reason
  @canceled_reason
end

#countObject

Returns the value of attribute count

Returns:

  • (Object)

    the current value of count



9
10
11
# File 'lib/exa/resources/webset_search.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/webset_search.rb', line 9

def created_at
  @created_at
end

#criteriaObject

Returns the value of attribute criteria

Returns:

  • (Object)

    the current value of criteria



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

def criteria
  @criteria
end

#entityObject

Returns the value of attribute entity

Returns:

  • (Object)

    the current value of entity



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

def entity
  @entity
end

#excludeObject

Returns the value of attribute exclude

Returns:

  • (Object)

    the current value of exclude



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

def exclude
  @exclude
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



9
10
11
# File 'lib/exa/resources/webset_search.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/webset_search.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/webset_search.rb', line 9

def object
  @object
end

#progressObject

Returns the value of attribute progress

Returns:

  • (Object)

    the current value of progress



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

def progress
  @progress
end

#queryObject

Returns the value of attribute query

Returns:

  • (Object)

    the current value of query



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

def query
  @query
end

#recallObject

Returns the value of attribute recall

Returns:

  • (Object)

    the current value of recall



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

def recall
  @recall
end

#scopeObject

Returns the value of attribute scope

Returns:

  • (Object)

    the current value of scope



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

def scope
  @scope
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



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

def status
  @status
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/webset_search.rb', line 9

def updated_at
  @updated_at
end

#webset_idObject

Returns the value of attribute webset_id

Returns:

  • (Object)

    the current value of webset_id



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

def webset_id
  @webset_id
end

Instance Method Details

#append?Boolean

Returns:

  • (Boolean)


84
85
86
# File 'lib/exa/resources/webset_search.rb', line 84

def append?
  behavior == "append"
end

#canceled?Boolean

Returns:

  • (Boolean)


71
72
73
# File 'lib/exa/resources/webset_search.rb', line 71

def canceled?
  status == "canceled"
end

#completed?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/exa/resources/webset_search.rb', line 63

def completed?
  status == "completed"
end

#created?Boolean

Status helper methods

Returns:

  • (Boolean)


55
56
57
# File 'lib/exa/resources/webset_search.rb', line 55

def created?
  status == "created"
end

#failed?Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/exa/resources/webset_search.rb', line 67

def failed?
  status == "failed"
end

#in_progress?Boolean

Returns:

  • (Boolean)


75
76
77
# File 'lib/exa/resources/webset_search.rb', line 75

def in_progress?
  created? || running?
end

#override?Boolean

Behavior helper methods

Returns:

  • (Boolean)


80
81
82
# File 'lib/exa/resources/webset_search.rb', line 80

def override?
  behavior == "override"
end

#running?Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/exa/resources/webset_search.rb', line 59

def running?
  status == "running"
end

#to_hObject



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/exa/resources/webset_search.rb', line 88

def to_h
  {
    id: id,
    object: object,
    status: status,
    webset_id: webset_id,
    query: query,
    entity: entity,
    criteria: criteria,
    count: count,
    behavior: behavior,
    exclude: exclude,
    scope: scope,
    progress: progress,
    recall: recall,
    metadata: ,
    canceled_at: canceled_at,
    canceled_reason: canceled_reason,
    created_at: created_at,
    updated_at: updated_at
  }.compact
end