Class: FetchHive::Generated::KnowledgeBaseObject

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/fetch_hive/generated/models/knowledge_base_object.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ KnowledgeBaseObject

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 106

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `FetchHive::Generated::KnowledgeBaseObject` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `FetchHive::Generated::KnowledgeBaseObject`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'id')
    self.id = attributes[:'id']
  else
    self.id = nil
  end

  if attributes.key?(:'name')
    self.name = attributes[:'name']
  else
    self.name = nil
  end

  if attributes.key?(:'description')
    self.description = attributes[:'description']
  end

  if attributes.key?(:'data_item_count')
    self.data_item_count = attributes[:'data_item_count']
  else
    self.data_item_count = nil
  end

  if attributes.key?(:'search_score_threshold')
    self.search_score_threshold = attributes[:'search_score_threshold']
  else
    self.search_score_threshold = nil
  end

  if attributes.key?(:'search_chunk_limit')
    self.search_chunk_limit = attributes[:'search_chunk_limit']
  else
    self.search_chunk_limit = nil
  end

  if attributes.key?(:'generated_at')
    self.generated_at = attributes[:'generated_at']
  end

  if attributes.key?(:'status')
    self.status = attributes[:'status']
  else
    self.status = nil
  end

  if attributes.key?(:'search_type')
    self.search_type = attributes[:'search_type']
  else
    self.search_type = nil
  end

  if attributes.key?(:'is_active')
    self.is_active = attributes[:'is_active']
  else
    self.is_active = nil
  end

  if attributes.key?(:'is_archived')
    self.is_archived = attributes[:'is_archived']
  else
    self.is_archived = nil
  end

  if attributes.key?(:'is_hybrid_search')
    self.is_hybrid_search = attributes[:'is_hybrid_search']
  else
    self.is_hybrid_search = nil
  end

  if attributes.key?(:'is_vector_search')
    self.is_vector_search = attributes[:'is_vector_search']
  else
    self.is_vector_search = nil
  end

  if attributes.key?(:'is_full_text_search')
    self.is_full_text_search = attributes[:'is_full_text_search']
  else
    self.is_full_text_search = nil
  end
end

Instance Attribute Details

#data_item_countObject

Returns the value of attribute data_item_count.



25
26
27
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 25

def data_item_count
  @data_item_count
end

#descriptionObject

(value may be null)



23
24
25
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 23

def description
  @description
end

#generated_atObject

(value may be null)



32
33
34
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 32

def generated_at
  @generated_at
end

#idObject

Returns the value of attribute id.



18
19
20
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 18

def id
  @id
end

#is_activeObject

Returns the value of attribute is_active.



38
39
40
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 38

def is_active
  @is_active
end

#is_archivedObject

Returns the value of attribute is_archived.



40
41
42
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 40

def is_archived
  @is_archived
end

#is_full_text_searchObject

Returns the value of attribute is_full_text_search.



46
47
48
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 46

def is_full_text_search
  @is_full_text_search
end

#is_hybrid_searchObject

Returns the value of attribute is_hybrid_search.



42
43
44
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 42

def is_hybrid_search
  @is_hybrid_search
end

#is_vector_searchObject

Returns the value of attribute is_vector_search.



44
45
46
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 44

def is_vector_search
  @is_vector_search
end

#nameObject

Returns the value of attribute name.



20
21
22
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 20

def name
  @name
end

#search_chunk_limitObject

Returns the value of attribute search_chunk_limit.



29
30
31
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 29

def search_chunk_limit
  @search_chunk_limit
end

#search_score_thresholdObject

Returns the value of attribute search_score_threshold.



27
28
29
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 27

def search_score_threshold
  @search_score_threshold
end

#search_typeObject

Returns the value of attribute search_type.



36
37
38
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 36

def search_type
  @search_type
end

#statusObject

Returns the value of attribute status.



34
35
36
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 34

def status
  @status
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



69
70
71
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 69

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



74
75
76
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 74

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 49

def self.attribute_map
  {
    :'id' => :'id',
    :'name' => :'name',
    :'description' => :'description',
    :'data_item_count' => :'data_item_count',
    :'search_score_threshold' => :'search_score_threshold',
    :'search_chunk_limit' => :'search_chunk_limit',
    :'generated_at' => :'generated_at',
    :'status' => :'status',
    :'search_type' => :'search_type',
    :'is_active' => :'is_active',
    :'is_archived' => :'is_archived',
    :'is_hybrid_search' => :'is_hybrid_search',
    :'is_vector_search' => :'is_vector_search',
    :'is_full_text_search' => :'is_full_text_search'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 432

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



99
100
101
102
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 99

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 79

def self.openapi_types
  {
    :'id' => :'String',
    :'name' => :'String',
    :'description' => :'String',
    :'data_item_count' => :'Integer',
    :'search_score_threshold' => :'String',
    :'search_chunk_limit' => :'Integer',
    :'generated_at' => :'Time',
    :'status' => :'String',
    :'search_type' => :'String',
    :'is_active' => :'Boolean',
    :'is_archived' => :'Boolean',
    :'is_hybrid_search' => :'Boolean',
    :'is_vector_search' => :'Boolean',
    :'is_full_text_search' => :'Boolean'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 398

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      name == o.name &&
      description == o.description &&
      data_item_count == o.data_item_count &&
      search_score_threshold == o.search_score_threshold &&
      search_chunk_limit == o.search_chunk_limit &&
      generated_at == o.generated_at &&
      status == o.status &&
      search_type == o.search_type &&
      is_active == o.is_active &&
      is_archived == o.is_archived &&
      is_hybrid_search == o.is_hybrid_search &&
      is_vector_search == o.is_vector_search &&
      is_full_text_search == o.is_full_text_search
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


419
420
421
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 419

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



425
426
427
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 425

def hash
  [id, name, description, data_item_count, search_score_threshold, search_chunk_limit, generated_at, status, search_type, is_active, is_archived, is_hybrid_search, is_vector_search, is_full_text_search].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 203

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @id.nil?
    invalid_properties.push('invalid value for "id", id cannot be nil.')
  end

  if @name.nil?
    invalid_properties.push('invalid value for "name", name cannot be nil.')
  end

  if @data_item_count.nil?
    invalid_properties.push('invalid value for "data_item_count", data_item_count cannot be nil.')
  end

  if @search_score_threshold.nil?
    invalid_properties.push('invalid value for "search_score_threshold", search_score_threshold cannot be nil.')
  end

  if @search_chunk_limit.nil?
    invalid_properties.push('invalid value for "search_chunk_limit", search_chunk_limit cannot be nil.')
  end

  if @status.nil?
    invalid_properties.push('invalid value for "status", status cannot be nil.')
  end

  if @search_type.nil?
    invalid_properties.push('invalid value for "search_type", search_type cannot be nil.')
  end

  if @is_active.nil?
    invalid_properties.push('invalid value for "is_active", is_active cannot be nil.')
  end

  if @is_archived.nil?
    invalid_properties.push('invalid value for "is_archived", is_archived cannot be nil.')
  end

  if @is_hybrid_search.nil?
    invalid_properties.push('invalid value for "is_hybrid_search", is_hybrid_search cannot be nil.')
  end

  if @is_vector_search.nil?
    invalid_properties.push('invalid value for "is_vector_search", is_vector_search cannot be nil.')
  end

  if @is_full_text_search.nil?
    invalid_properties.push('invalid value for "is_full_text_search", is_full_text_search cannot be nil.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



454
455
456
457
458
459
460
461
462
463
464
465
466
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 454

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/fetch_hive/generated/models/knowledge_base_object.rb', line 259

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @id.nil?
  return false if @name.nil?
  return false if @data_item_count.nil?
  return false if @search_score_threshold.nil?
  return false if @search_chunk_limit.nil?
  return false if @status.nil?
  return false if @search_type.nil?
  return false if @is_active.nil?
  return false if @is_archived.nil?
  return false if @is_hybrid_search.nil?
  return false if @is_vector_search.nil?
  return false if @is_full_text_search.nil?
  true
end