Class: NewDemoApiClient::BandResponse
- Inherits:
-
Object
- Object
- NewDemoApiClient::BandResponse
- Defined in:
- lib/test_sdk/types/band_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#alpha ⇒ Float
readonly
Quantile significance level for the band, which represents the share of data points expected to lie beyond the band.
- #high ⇒ Array<Float> readonly
- #low ⇒ Array<Float> readonly
- #x ⇒ Array<Float> readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ NewDemoApiClient::BandResponse
Deserialize a JSON object to an instance of BandResponse.
-
.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(alpha:, x: OMIT, low: OMIT, high: OMIT, additional_properties: nil) ⇒ NewDemoApiClient::BandResponse constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of BandResponse to a JSON object.
Constructor Details
#initialize(alpha:, x: OMIT, low: OMIT, high: OMIT, additional_properties: nil) ⇒ NewDemoApiClient::BandResponse
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/test_sdk/types/band_response.rb', line 32 def initialize(alpha:, x: OMIT, low: OMIT, high: OMIT, additional_properties: nil) @alpha = alpha @x = x if x != OMIT @low = low if low != OMIT @high = high if high != OMIT @additional_properties = additional_properties @_field_set = { "alpha": alpha, "x": x, "low": low, "high": high }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
18 19 20 |
# File 'lib/test_sdk/types/band_response.rb', line 18 def additional_properties @additional_properties end |
#alpha ⇒ Float (readonly)
Returns Quantile significance level for the band, which represents the share of data points expected to lie beyond the band.
10 11 12 |
# File 'lib/test_sdk/types/band_response.rb', line 10 def alpha @alpha end |
#high ⇒ Array<Float> (readonly)
16 17 18 |
# File 'lib/test_sdk/types/band_response.rb', line 16 def high @high end |
#low ⇒ Array<Float> (readonly)
14 15 16 |
# File 'lib/test_sdk/types/band_response.rb', line 14 def low @low end |
#x ⇒ Array<Float> (readonly)
12 13 14 |
# File 'lib/test_sdk/types/band_response.rb', line 12 def x @x end |
Class Method Details
.from_json(json_object:) ⇒ NewDemoApiClient::BandResponse
Deserialize a JSON object to an instance of BandResponse
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/test_sdk/types/band_response.rb', line 47 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) alpha = parsed_json["alpha"] x = parsed_json["x"] low = parsed_json["low"] high = parsed_json["high"] new( alpha: alpha, x: x, low: low, high: high, 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.
76 77 78 79 80 81 |
# File 'lib/test_sdk/types/band_response.rb', line 76 def self.validate_raw(obj:) obj.alpha.is_a?(Float) != false || raise("Passed value for field obj.alpha is not the expected type, validation failed.") obj.x&.is_a?(Array) != false || raise("Passed value for field obj.x is not the expected type, validation failed.") obj.low&.is_a?(Array) != false || raise("Passed value for field obj.low is not the expected type, validation failed.") obj.high&.is_a?(Array) != false || raise("Passed value for field obj.high is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of BandResponse to a JSON object
66 67 68 |
# File 'lib/test_sdk/types/band_response.rb', line 66 def to_json(*_args) @_field_set&.to_json end |