Class: NewDemoApiClient::WeatherMarketContext
- Inherits:
-
Object
- Object
- NewDemoApiClient::WeatherMarketContext
- Defined in:
- lib/test_sdk/types/weather_market_context.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#average_amount_raised ⇒ Float
readonly
The average amount raised in the market at the stage in a rolling window.
-
#average_raise_years ⇒ Float
readonly
The average number of years between raises in the market at the stage in a rolling window.
-
#date ⇒ String
readonly
The date of the data point.
-
#rounds_annualized ⇒ Float
readonly
A simple estimate of total count of rounds in the market at the stage in a rolling window.
-
#stage ⇒ String
readonly
The stage of the weather gauge.
-
#total_amount_raised_annualized ⇒ Float
readonly
A simple estimate of total amount of fundraising in the market at the stage in a rolling window.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ NewDemoApiClient::WeatherMarketContext
Deserialize a JSON object to an instance of WeatherMarketContext.
-
.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(stage:, date:, total_amount_raised_annualized: OMIT, rounds_annualized: OMIT, average_raise_years: OMIT, average_amount_raised: OMIT, additional_properties: nil) ⇒ NewDemoApiClient::WeatherMarketContext constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of WeatherMarketContext to a JSON object.
Constructor Details
#initialize(stage:, date:, total_amount_raised_annualized: OMIT, rounds_annualized: OMIT, average_raise_years: OMIT, average_amount_raised: OMIT, additional_properties: nil) ⇒ NewDemoApiClient::WeatherMarketContext
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/test_sdk/types/weather_market_context.rb', line 42 def initialize(stage:, date:, total_amount_raised_annualized: OMIT, rounds_annualized: OMIT, average_raise_years: OMIT, average_amount_raised: OMIT, additional_properties: nil) @stage = stage @date = date @total_amount_raised_annualized = total_amount_raised_annualized if total_amount_raised_annualized != OMIT @rounds_annualized = rounds_annualized if rounds_annualized != OMIT @average_raise_years = average_raise_years if average_raise_years != OMIT @average_amount_raised = average_amount_raised if average_amount_raised != OMIT @additional_properties = additional_properties @_field_set = { "stage": stage, "date": date, "total_amount_raised_annualized": total_amount_raised_annualized, "rounds_annualized": rounds_annualized, "average_raise_years": average_raise_years, "average_amount_raised": average_amount_raised }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
24 25 26 |
# File 'lib/test_sdk/types/weather_market_context.rb', line 24 def additional_properties @additional_properties end |
#average_amount_raised ⇒ Float (readonly)
Returns The average amount raised in the market at the stage in a rolling window.
22 23 24 |
# File 'lib/test_sdk/types/weather_market_context.rb', line 22 def average_amount_raised @average_amount_raised end |
#average_raise_years ⇒ Float (readonly)
Returns The average number of years between raises in the market at the stage in a rolling window.
20 21 22 |
# File 'lib/test_sdk/types/weather_market_context.rb', line 20 def average_raise_years @average_raise_years end |
#date ⇒ String (readonly)
Returns The date of the data point.
11 12 13 |
# File 'lib/test_sdk/types/weather_market_context.rb', line 11 def date @date end |
#rounds_annualized ⇒ Float (readonly)
Returns A simple estimate of total count of rounds in the market at the stage in a rolling window.
17 18 19 |
# File 'lib/test_sdk/types/weather_market_context.rb', line 17 def rounds_annualized @rounds_annualized end |
#stage ⇒ String (readonly)
Returns The stage of the weather gauge.
9 10 11 |
# File 'lib/test_sdk/types/weather_market_context.rb', line 9 def stage @stage end |
#total_amount_raised_annualized ⇒ Float (readonly)
Returns A simple estimate of total amount of fundraising in the market at the stage in a rolling window.
14 15 16 |
# File 'lib/test_sdk/types/weather_market_context.rb', line 14 def total_amount_raised_annualized @total_amount_raised_annualized end |
Class Method Details
.from_json(json_object:) ⇒ NewDemoApiClient::WeatherMarketContext
Deserialize a JSON object to an instance of WeatherMarketContext
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/test_sdk/types/weather_market_context.rb', line 67 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) stage = parsed_json["stage"] date = parsed_json["date"] total_amount_raised_annualized = parsed_json["total_amount_raised_annualized"] rounds_annualized = parsed_json["rounds_annualized"] average_raise_years = parsed_json["average_raise_years"] average_amount_raised = parsed_json["average_amount_raised"] new( stage: stage, date: date, total_amount_raised_annualized: total_amount_raised_annualized, rounds_annualized: rounds_annualized, average_raise_years: average_raise_years, average_amount_raised: average_amount_raised, 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.
100 101 102 103 104 105 106 107 |
# File 'lib/test_sdk/types/weather_market_context.rb', line 100 def self.validate_raw(obj:) obj.stage.is_a?(String) != false || raise("Passed value for field obj.stage is not the expected type, validation failed.") obj.date.is_a?(String) != false || raise("Passed value for field obj.date is not the expected type, validation failed.") obj.total_amount_raised_annualized&.is_a?(Float) != false || raise("Passed value for field obj.total_amount_raised_annualized is not the expected type, validation failed.") obj.rounds_annualized&.is_a?(Float) != false || raise("Passed value for field obj.rounds_annualized is not the expected type, validation failed.") obj.average_raise_years&.is_a?(Float) != false || raise("Passed value for field obj.average_raise_years is not the expected type, validation failed.") obj.average_amount_raised&.is_a?(Float) != false || raise("Passed value for field obj.average_amount_raised is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of WeatherMarketContext to a JSON object
90 91 92 |
# File 'lib/test_sdk/types/weather_market_context.rb', line 90 def to_json(*_args) @_field_set&.to_json end |