Class: Exa::Resources::WebsetSearch
- Inherits:
-
Struct
- Object
- Struct
- Exa::Resources::WebsetSearch
- 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
-
#behavior ⇒ Object
Returns the value of attribute behavior.
-
#canceled_at ⇒ Object
Returns the value of attribute canceled_at.
-
#canceled_reason ⇒ Object
Returns the value of attribute canceled_reason.
-
#count ⇒ Object
Returns the value of attribute count.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#criteria ⇒ Object
Returns the value of attribute criteria.
-
#entity ⇒ Object
Returns the value of attribute entity.
-
#exclude ⇒ Object
Returns the value of attribute exclude.
-
#id ⇒ Object
Returns the value of attribute id.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#object ⇒ Object
Returns the value of attribute object.
-
#progress ⇒ Object
Returns the value of attribute progress.
-
#query ⇒ Object
Returns the value of attribute query.
-
#recall ⇒ Object
Returns the value of attribute recall.
-
#scope ⇒ Object
Returns the value of attribute scope.
-
#status ⇒ Object
Returns the value of attribute status.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#webset_id ⇒ Object
Returns the value of attribute webset_id.
Instance Method Summary collapse
- #append? ⇒ Boolean
- #canceled? ⇒ Boolean
- #completed? ⇒ Boolean
-
#created? ⇒ Boolean
Status helper methods.
- #failed? ⇒ Boolean
- #in_progress? ⇒ Boolean
-
#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
constructor
A new instance of WebsetSearch.
-
#override? ⇒ Boolean
Behavior helper methods.
- #running? ⇒ Boolean
- #to_h ⇒ Object
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
#behavior ⇒ Object
Returns the value of attribute behavior
9 10 11 |
# File 'lib/exa/resources/webset_search.rb', line 9 def behavior @behavior end |
#canceled_at ⇒ Object
Returns the value of attribute canceled_at
9 10 11 |
# File 'lib/exa/resources/webset_search.rb', line 9 def canceled_at @canceled_at end |
#canceled_reason ⇒ Object
Returns the value of attribute canceled_reason
9 10 11 |
# File 'lib/exa/resources/webset_search.rb', line 9 def canceled_reason @canceled_reason end |
#count ⇒ Object
Returns the value of attribute count
9 10 11 |
# File 'lib/exa/resources/webset_search.rb', line 9 def count @count end |
#created_at ⇒ Object
Returns the value of attribute created_at
9 10 11 |
# File 'lib/exa/resources/webset_search.rb', line 9 def created_at @created_at end |
#criteria ⇒ Object
Returns the value of attribute criteria
9 10 11 |
# File 'lib/exa/resources/webset_search.rb', line 9 def criteria @criteria end |
#entity ⇒ Object
Returns the value of attribute entity
9 10 11 |
# File 'lib/exa/resources/webset_search.rb', line 9 def entity @entity end |
#exclude ⇒ Object
Returns the value of attribute exclude
9 10 11 |
# File 'lib/exa/resources/webset_search.rb', line 9 def exclude @exclude end |
#id ⇒ Object
Returns the value of attribute id
9 10 11 |
# File 'lib/exa/resources/webset_search.rb', line 9 def id @id end |
#metadata ⇒ Object
Returns the value of attribute metadata
9 10 11 |
# File 'lib/exa/resources/webset_search.rb', line 9 def end |
#object ⇒ Object
Returns the value of attribute object
9 10 11 |
# File 'lib/exa/resources/webset_search.rb', line 9 def object @object end |
#progress ⇒ Object
Returns the value of attribute progress
9 10 11 |
# File 'lib/exa/resources/webset_search.rb', line 9 def progress @progress end |
#query ⇒ Object
Returns the value of attribute query
9 10 11 |
# File 'lib/exa/resources/webset_search.rb', line 9 def query @query end |
#recall ⇒ Object
Returns the value of attribute recall
9 10 11 |
# File 'lib/exa/resources/webset_search.rb', line 9 def recall @recall end |
#scope ⇒ Object
Returns the value of attribute scope
9 10 11 |
# File 'lib/exa/resources/webset_search.rb', line 9 def scope @scope end |
#status ⇒ Object
Returns the value of attribute status
9 10 11 |
# File 'lib/exa/resources/webset_search.rb', line 9 def status @status end |
#updated_at ⇒ Object
Returns the value of attribute updated_at
9 10 11 |
# File 'lib/exa/resources/webset_search.rb', line 9 def updated_at @updated_at end |
#webset_id ⇒ Object
Returns the value of attribute 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
84 85 86 |
# File 'lib/exa/resources/webset_search.rb', line 84 def append? behavior == "append" end |
#canceled? ⇒ Boolean
71 72 73 |
# File 'lib/exa/resources/webset_search.rb', line 71 def canceled? status == "canceled" end |
#completed? ⇒ Boolean
63 64 65 |
# File 'lib/exa/resources/webset_search.rb', line 63 def completed? status == "completed" end |
#created? ⇒ Boolean
Status helper methods
55 56 57 |
# File 'lib/exa/resources/webset_search.rb', line 55 def created? status == "created" end |
#failed? ⇒ Boolean
67 68 69 |
# File 'lib/exa/resources/webset_search.rb', line 67 def failed? status == "failed" end |
#in_progress? ⇒ Boolean
75 76 77 |
# File 'lib/exa/resources/webset_search.rb', line 75 def in_progress? created? || running? end |
#override? ⇒ Boolean
Behavior helper methods
80 81 82 |
# File 'lib/exa/resources/webset_search.rb', line 80 def override? behavior == "override" end |
#running? ⇒ Boolean
59 60 61 |
# File 'lib/exa/resources/webset_search.rb', line 59 def running? status == "running" end |
#to_h ⇒ Object
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 |