Class: NewDemoApiClient::AvailableModelsResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/test_sdk/types/available_models_response.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scaling:, tradeoff_at_scale:, additional_properties: nil) ⇒ NewDemoApiClient::AvailableModelsResponse

Parameters:

  • scaling (Array<String>)

    Available scaling models that measure how one metric evolves against a geometric scaling parameter like revenue or number of years or effort.

  • tradeoff_at_scale (Array<String>)

    Available tradeoff models that measure the tradeoff between two metrics at a given revenue scale.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



28
29
30
31
32
33
# File 'lib/test_sdk/types/available_models_response.rb', line 28

def initialize(scaling:, tradeoff_at_scale:, additional_properties: nil)
  @scaling = scaling
  @tradeoff_at_scale = tradeoff_at_scale
  @additional_properties = additional_properties
  @_field_set = { "scaling": scaling, "tradeoff_at_scale": tradeoff_at_scale }
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



15
16
17
# File 'lib/test_sdk/types/available_models_response.rb', line 15

def additional_properties
  @additional_properties
end

#scalingArray<String> (readonly)

Returns Available scaling models that measure how one metric evolves against a geometric scaling parameter like revenue or number of years or effort.

Returns:

  • (Array<String>)

    Available scaling models that measure how one metric evolves against a geometric scaling parameter like revenue or number of years or effort.



10
11
12
# File 'lib/test_sdk/types/available_models_response.rb', line 10

def scaling
  @scaling
end

#tradeoff_at_scaleArray<String> (readonly)

Returns Available tradeoff models that measure the tradeoff between two metrics at a given revenue scale.

Returns:

  • (Array<String>)

    Available tradeoff models that measure the tradeoff between two metrics at a given revenue scale.



13
14
15
# File 'lib/test_sdk/types/available_models_response.rb', line 13

def tradeoff_at_scale
  @tradeoff_at_scale
end

Class Method Details

.from_json(json_object:) ⇒ NewDemoApiClient::AvailableModelsResponse

Deserialize a JSON object to an instance of AvailableModelsResponse

Parameters:

  • json_object (String)

Returns:



39
40
41
42
43
44
45
46
47
48
49
# File 'lib/test_sdk/types/available_models_response.rb', line 39

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  scaling = parsed_json["scaling"]
  tradeoff_at_scale = parsed_json["tradeoff_at_scale"]
  new(
    scaling: scaling,
    tradeoff_at_scale: tradeoff_at_scale,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Leveraged for Union-type generation, validate_raw attempts to parse the given

hash and check each fields type against the current object's property
definitions.

Parameters:

  • obj (Object)

Returns:

  • (Void)


64
65
66
67
# File 'lib/test_sdk/types/available_models_response.rb', line 64

def self.validate_raw(obj:)
  obj.scaling.is_a?(Array) != false || raise("Passed value for field obj.scaling is not the expected type, validation failed.")
  obj.tradeoff_at_scale.is_a?(Array) != false || raise("Passed value for field obj.tradeoff_at_scale is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of AvailableModelsResponse to a JSON object

Returns:

  • (String)


54
55
56
# File 'lib/test_sdk/types/available_models_response.rb', line 54

def to_json(*_args)
  @_field_set&.to_json
end