Class: NewDemoApiClient::AvailableModelsResponse
- Inherits:
-
Object
- Object
- NewDemoApiClient::AvailableModelsResponse
- Defined in:
- lib/test_sdk/types/available_models_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#scaling ⇒ Array<String>
readonly
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>
readonly
Available tradeoff models that measure the tradeoff between two metrics at a given revenue scale.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ NewDemoApiClient::AvailableModelsResponse
Deserialize a JSON object to an instance of AvailableModelsResponse.
-
.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.
Instance Method Summary collapse
- #initialize(scaling:, tradeoff_at_scale:, additional_properties: nil) ⇒ NewDemoApiClient::AvailableModelsResponse constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of AvailableModelsResponse to a JSON object.
Constructor Details
#initialize(scaling:, tradeoff_at_scale:, additional_properties: nil) ⇒ NewDemoApiClient::AvailableModelsResponse
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_properties ⇒ OpenStruct (readonly)
Returns 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 |
#scaling ⇒ Array<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.
10 11 12 |
# File 'lib/test_sdk/types/available_models_response.rb', line 10 def scaling @scaling end |
#tradeoff_at_scale ⇒ Array<String> (readonly)
Returns 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
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.
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
54 55 56 |
# File 'lib/test_sdk/types/available_models_response.rb', line 54 def to_json(*_args) @_field_set&.to_json end |