Class: NewDemoApiClient::WeatherComponents

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stage:, date:, weather_gauge: OMIT, actual_annualized: OMIT, potential_annualized: OMIT, potential_annualized_forecast: OMIT, additional_properties: nil) ⇒ NewDemoApiClient::WeatherComponents

Parameters:

  • stage (String)

    The stage of the weather gauge

  • date (String)

    The date of the data point

  • weather_gauge (Float) (defaults to: OMIT)

    The values of the individual components of the weather gauge

  • actual_annualized (Float) (defaults to: OMIT)

    The measured actual annualized fundraising amount for the stage in a rolling window, subset only to companies that have known amounts raised in the prior stage. The value is null for future dates beyond the last valid date of the indicator

  • potential_annualized (Float) (defaults to: OMIT)

    The estimated present and past potential annualized fundraising amount for the stage in a rolling window, which measures the amount of fundraising one would expect under normal conditions, based on investment in the prior stage and accounting for exits. The value is null for future dates beyond the last valid date of the indicator

  • potential_annualized_forecast (Float) (defaults to: OMIT)

    The estimated future potential annualized fundraising amount for the stage in a rolling window, which measures the amount of fundraising one would expect under normal conditions, based on investment in the prior stage and accounting for exits. The value is null for past dates and forecasted for future dates

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/test_sdk/types/weather_components.rb', line 56

def initialize(stage:, date:, weather_gauge: OMIT, actual_annualized: OMIT, potential_annualized: OMIT,
               potential_annualized_forecast: OMIT, additional_properties: nil)
  @stage = stage
  @date = date
  @weather_gauge = weather_gauge if weather_gauge != OMIT
  @actual_annualized = actual_annualized if actual_annualized != OMIT
  @potential_annualized = potential_annualized if potential_annualized != OMIT
  @potential_annualized_forecast = potential_annualized_forecast if potential_annualized_forecast != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "stage": stage,
    "date": date,
    "weather_gauge": weather_gauge,
    "actual_annualized": actual_annualized,
    "potential_annualized": potential_annualized,
    "potential_annualized_forecast": potential_annualized_forecast
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#actual_annualizedFloat (readonly)

Returns The measured actual annualized fundraising amount for the stage in a rolling window, subset only to companies that have known amounts raised in the prior stage. The value is null for future dates beyond the last valid date of the indicator.

Returns:

  • (Float)

    The measured actual annualized fundraising amount for the stage in a rolling window, subset only to companies that have known amounts raised in the prior stage. The value is null for future dates beyond the last valid date of the indicator



18
19
20
# File 'lib/test_sdk/types/weather_components.rb', line 18

def actual_annualized
  @actual_annualized
end

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



31
32
33
# File 'lib/test_sdk/types/weather_components.rb', line 31

def additional_properties
  @additional_properties
end

#dateString (readonly)

Returns The date of the data point.

Returns:

  • (String)

    The date of the data point



11
12
13
# File 'lib/test_sdk/types/weather_components.rb', line 11

def date
  @date
end

#potential_annualizedFloat (readonly)

Returns The estimated present and past potential annualized fundraising amount for the stage in a rolling window, which measures the amount of fundraising one would expect under normal conditions, based on investment in the prior stage and accounting for exits. The value is null for future dates beyond the last valid date of the indicator.

Returns:

  • (Float)

    The estimated present and past potential annualized fundraising amount for the stage in a rolling window, which measures the amount of fundraising one would expect under normal conditions, based on investment in the prior stage and accounting for exits. The value is null for future dates beyond the last valid date of the indicator



24
25
26
# File 'lib/test_sdk/types/weather_components.rb', line 24

def potential_annualized
  @potential_annualized
end

#potential_annualized_forecastFloat (readonly)

Returns The estimated future potential annualized fundraising amount for the stage in a rolling window, which measures the amount of fundraising one would expect under normal conditions, based on investment in the prior stage and accounting for exits. The value is null for past dates and forecasted for future dates.

Returns:

  • (Float)

    The estimated future potential annualized fundraising amount for the stage in a rolling window, which measures the amount of fundraising one would expect under normal conditions, based on investment in the prior stage and accounting for exits. The value is null for past dates and forecasted for future dates



29
30
31
# File 'lib/test_sdk/types/weather_components.rb', line 29

def potential_annualized_forecast
  @potential_annualized_forecast
end

#stageString (readonly)

Returns The stage of the weather gauge.

Returns:

  • (String)

    The stage of the weather gauge



9
10
11
# File 'lib/test_sdk/types/weather_components.rb', line 9

def stage
  @stage
end

#weather_gaugeFloat (readonly)

Returns The values of the individual components of the weather gauge.

Returns:

  • (Float)

    The values of the individual components of the weather gauge



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

def weather_gauge
  @weather_gauge
end

Class Method Details

.from_json(json_object:) ⇒ NewDemoApiClient::WeatherComponents

Deserialize a JSON object to an instance of WeatherComponents

Parameters:

  • json_object (String)

Returns:



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/test_sdk/types/weather_components.rb', line 81

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"]
  weather_gauge = parsed_json["weather_gauge"]
  actual_annualized = parsed_json["actual_annualized"]
  potential_annualized = parsed_json["potential_annualized"]
  potential_annualized_forecast = parsed_json["potential_annualized_forecast"]
  new(
    stage: stage,
    date: date,
    weather_gauge: weather_gauge,
    actual_annualized: actual_annualized,
    potential_annualized: potential_annualized,
    potential_annualized_forecast: potential_annualized_forecast,
    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)


114
115
116
117
118
119
120
121
# File 'lib/test_sdk/types/weather_components.rb', line 114

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.weather_gauge&.is_a?(Float) != false || raise("Passed value for field obj.weather_gauge is not the expected type, validation failed.")
  obj.actual_annualized&.is_a?(Float) != false || raise("Passed value for field obj.actual_annualized is not the expected type, validation failed.")
  obj.potential_annualized&.is_a?(Float) != false || raise("Passed value for field obj.potential_annualized is not the expected type, validation failed.")
  obj.potential_annualized_forecast&.is_a?(Float) != false || raise("Passed value for field obj.potential_annualized_forecast is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of WeatherComponents to a JSON object

Returns:

  • (String)


104
105
106
# File 'lib/test_sdk/types/weather_components.rb', line 104

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