Class: OpencodeClient::ProviderConfigModelsValue

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/opencode_client/models/provider_config_models_value.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 = {}) ⇒ ProviderConfigModelsValue

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 138

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `OpencodeClient::ProviderConfigModelsValue` 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 `OpencodeClient::ProviderConfigModelsValue`. 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']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

  if attributes.key?(:'options')
    if (value = attributes[:'options']).is_a?(Hash)
      self.options = value
    end
  end

  if attributes.key?(:'headers')
    if (value = attributes[:'headers']).is_a?(Hash)
      self.headers = value
    end
  end

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

Instance Attribute Details

#attachmentObject

Returns the value of attribute attachment.



26
27
28
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 26

def attachment
  @attachment
end

#costObject

Returns the value of attribute cost.



36
37
38
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 36

def cost
  @cost
end

#experimentalObject

Returns the value of attribute experimental.



42
43
44
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 42

def experimental
  @experimental
end

#familyObject

Returns the value of attribute family.



22
23
24
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 22

def family
  @family
end

#headersObject

Returns the value of attribute headers.



48
49
50
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 48

def headers
  @headers
end

#idObject

Returns the value of attribute id.



18
19
20
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 18

def id
  @id
end

#interleavedObject

Returns the value of attribute interleaved.



34
35
36
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 34

def interleaved
  @interleaved
end

#limitObject

Returns the value of attribute limit.



38
39
40
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 38

def limit
  @limit
end

#modalitiesObject

Returns the value of attribute modalities.



40
41
42
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 40

def modalities
  @modalities
end

#nameObject

Returns the value of attribute name.



20
21
22
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 20

def name
  @name
end

#optionsObject

Returns the value of attribute options.



46
47
48
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 46

def options
  @options
end

#providerObject

Returns the value of attribute provider.



50
51
52
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 50

def provider
  @provider
end

#reasoningObject

Returns the value of attribute reasoning.



28
29
30
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 28

def reasoning
  @reasoning
end

#release_dateObject

Returns the value of attribute release_date.



24
25
26
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 24

def release_date
  @release_date
end

#statusObject

Returns the value of attribute status.



44
45
46
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 44

def status
  @status
end

#temperatureObject

Returns the value of attribute temperature.



30
31
32
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 30

def temperature
  @temperature
end

#tool_callObject

Returns the value of attribute tool_call.



32
33
34
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 32

def tool_call
  @tool_call
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



98
99
100
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 98

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



103
104
105
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 103

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 75

def self.attribute_map
  {
    :'id' => :'id',
    :'name' => :'name',
    :'family' => :'family',
    :'release_date' => :'release_date',
    :'attachment' => :'attachment',
    :'reasoning' => :'reasoning',
    :'temperature' => :'temperature',
    :'tool_call' => :'tool_call',
    :'interleaved' => :'interleaved',
    :'cost' => :'cost',
    :'limit' => :'limit',
    :'modalities' => :'modalities',
    :'experimental' => :'experimental',
    :'status' => :'status',
    :'options' => :'options',
    :'headers' => :'headers',
    :'provider' => :'provider'
  }
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



291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 291

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



131
132
133
134
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 131

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

.openapi_typesObject

Attribute type mapping.



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 108

def self.openapi_types
  {
    :'id' => :'String',
    :'name' => :'String',
    :'family' => :'String',
    :'release_date' => :'String',
    :'attachment' => :'Boolean',
    :'reasoning' => :'Boolean',
    :'temperature' => :'Boolean',
    :'tool_call' => :'Boolean',
    :'interleaved' => :'ProviderConfigModelsValueInterleaved',
    :'cost' => :'ProviderList200ResponseAllInnerModelsValueCost',
    :'limit' => :'ProviderList200ResponseAllInnerModelsValueLimit',
    :'modalities' => :'ProviderList200ResponseAllInnerModelsValueModalities',
    :'experimental' => :'Boolean',
    :'status' => :'String',
    :'options' => :'Hash<String, Object>',
    :'headers' => :'Hash<String, String>',
    :'provider' => :'ProviderList200ResponseAllInnerModelsValueProvider'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 254

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      name == o.name &&
      family == o.family &&
      release_date == o.release_date &&
      attachment == o.attachment &&
      reasoning == o.reasoning &&
      temperature == o.temperature &&
      tool_call == o.tool_call &&
      interleaved == o.interleaved &&
      cost == o.cost &&
      limit == o.limit &&
      modalities == o.modalities &&
      experimental == o.experimental &&
      status == o.status &&
      options == o.options &&
      headers == o.headers &&
      provider == o.provider
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


278
279
280
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 278

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



284
285
286
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 284

def hash
  [id, name, family, release_date, attachment, reasoning, temperature, tool_call, interleaved, cost, limit, modalities, experimental, status, options, headers, provider].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



227
228
229
230
231
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 227

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



313
314
315
316
317
318
319
320
321
322
323
324
325
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 313

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



235
236
237
238
239
240
# File 'lib/opencode_client/models/provider_config_models_value.rb', line 235

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  status_validator = EnumAttributeValidator.new('String', ["alpha", "beta", "deprecated"])
  return false unless status_validator.valid?(@status)
  true
end