Class: FetchHive::Generated::GetPublicModels200ResponseInner

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

Defined Under Namespace

Classes: EnumAttributeValidator

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 = {}) ⇒ GetPublicModels200ResponseInner

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
200
201
202
203
# File 'lib/fetch_hive/generated/models/get_public_models200_response_inner.rb', line 118

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `FetchHive::Generated::GetPublicModels200ResponseInner` 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::GetPublicModels200ResponseInner`. 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?(:'slug')
    self.slug = attributes[:'slug']
  else
    self.slug = nil
  end

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#context_limitObject

Returns the value of attribute context_limit.



28
29
30
# File 'lib/fetch_hive/generated/models/get_public_models200_response_inner.rb', line 28

def context_limit
  @context_limit
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#is_image_generationObject

Returns the value of attribute is_image_generation.



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

def is_image_generation
  @is_image_generation
end

#is_json_schemaObject

Returns the value of attribute is_json_schema.



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

def is_json_schema
  @is_json_schema
end

#is_reasoningObject

Returns the value of attribute is_reasoning.



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

def is_reasoning
  @is_reasoning
end

#is_tool_callingObject

Returns the value of attribute is_tool_calling.



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

def is_tool_calling
  @is_tool_calling
end

#is_visionObject

Returns the value of attribute is_vision.



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

def is_vision
  @is_vision
end

#model_typeObject

Returns the value of attribute model_type.



30
31
32
# File 'lib/fetch_hive/generated/models/get_public_models200_response_inner.rb', line 30

def model_type
  @model_type
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#providerObject

Returns the value of attribute provider.



24
25
26
# File 'lib/fetch_hive/generated/models/get_public_models200_response_inner.rb', line 24

def provider
  @provider
end

#provider_nameObject

Returns the value of attribute provider_name.



26
27
28
# File 'lib/fetch_hive/generated/models/get_public_models200_response_inner.rb', line 26

def provider_name
  @provider_name
end

#slugObject

Returns the value of attribute slug.



22
23
24
# File 'lib/fetch_hive/generated/models/get_public_models200_response_inner.rb', line 22

def slug
  @slug
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



83
84
85
# File 'lib/fetch_hive/generated/models/get_public_models200_response_inner.rb', line 83

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



88
89
90
# File 'lib/fetch_hive/generated/models/get_public_models200_response_inner.rb', line 88

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/fetch_hive/generated/models/get_public_models200_response_inner.rb', line 65

def self.attribute_map
  {
    :'id' => :'id',
    :'name' => :'name',
    :'slug' => :'slug',
    :'provider' => :'provider',
    :'provider_name' => :'provider_name',
    :'context_limit' => :'context_limit',
    :'model_type' => :'model_type',
    :'is_image_generation' => :'is_image_generation',
    :'is_vision' => :'is_vision',
    :'is_reasoning' => :'is_reasoning',
    :'is_tool_calling' => :'is_tool_calling',
    :'is_json_schema' => :'is_json_schema'
  }
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



436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
# File 'lib/fetch_hive/generated/models/get_public_models200_response_inner.rb', line 436

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



111
112
113
114
# File 'lib/fetch_hive/generated/models/get_public_models200_response_inner.rb', line 111

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

.openapi_typesObject

Attribute type mapping.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/fetch_hive/generated/models/get_public_models200_response_inner.rb', line 93

def self.openapi_types
  {
    :'id' => :'String',
    :'name' => :'String',
    :'slug' => :'String',
    :'provider' => :'String',
    :'provider_name' => :'String',
    :'context_limit' => :'Integer',
    :'model_type' => :'String',
    :'is_image_generation' => :'Boolean',
    :'is_vision' => :'Boolean',
    :'is_reasoning' => :'Boolean',
    :'is_tool_calling' => :'Boolean',
    :'is_json_schema' => :'Boolean'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
# File 'lib/fetch_hive/generated/models/get_public_models200_response_inner.rb', line 404

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      name == o.name &&
      slug == o.slug &&
      provider == o.provider &&
      provider_name == o.provider_name &&
      context_limit == o.context_limit &&
      model_type == o.model_type &&
      is_image_generation == o.is_image_generation &&
      is_vision == o.is_vision &&
      is_reasoning == o.is_reasoning &&
      is_tool_calling == o.is_tool_calling &&
      is_json_schema == o.is_json_schema
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


423
424
425
# File 'lib/fetch_hive/generated/models/get_public_models200_response_inner.rb', line 423

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



429
430
431
# File 'lib/fetch_hive/generated/models/get_public_models200_response_inner.rb', line 429

def hash
  [id, name, slug, provider, provider_name, context_limit, model_type, is_image_generation, is_vision, is_reasoning, is_tool_calling, is_json_schema].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
256
257
258
259
# File 'lib/fetch_hive/generated/models/get_public_models200_response_inner.rb', line 207

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 @slug.nil?
    invalid_properties.push('invalid value for "slug", slug cannot be nil.')
  end

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

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

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

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

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

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

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

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

  if @is_json_schema.nil?
    invalid_properties.push('invalid value for "is_json_schema", is_json_schema 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



458
459
460
461
462
463
464
465
466
467
468
469
470
# File 'lib/fetch_hive/generated/models/get_public_models200_response_inner.rb', line 458

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



263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/fetch_hive/generated/models/get_public_models200_response_inner.rb', line 263

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @id.nil?
  return false if @name.nil?
  return false if @slug.nil?
  return false if @provider.nil?
  return false if @provider_name.nil?
  return false if @context_limit.nil?
  return false if @model_type.nil?
  model_type_validator = EnumAttributeValidator.new('String', ["llm", "image_generation"])
  return false unless model_type_validator.valid?(@model_type)
  return false if @is_image_generation.nil?
  return false if @is_vision.nil?
  return false if @is_reasoning.nil?
  return false if @is_tool_calling.nil?
  return false if @is_json_schema.nil?
  true
end