Class: NewDemoApiClient::FunctionLevelGrowthAccounting
- Inherits:
-
Object
- Object
- NewDemoApiClient::FunctionLevelGrowthAccounting
- Defined in:
- lib/test_sdk/types/function_level_growth_accounting.rb
Overview
Represents the growth accounting metrics at the function level for a company.
This model captures the changes in employee count within specific functions over
time.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#active ⇒ Integer
readonly
The number of active employees in the function during the period.
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#churned ⇒ Integer
readonly
The number of employees who left the function during the period.
-
#date ⇒ String
readonly
The date of the entry in YYYYQ format.
-
#function ⇒ String
readonly
The function or department within the company.
-
#new ⇒ Integer
readonly
The number of new employees in the function during the period.
-
#resurrected ⇒ Integer
readonly
The number of employees who left and returned to the function.
-
#retained ⇒ Integer
readonly
The number of employees retained in the function from the last period.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ NewDemoApiClient::FunctionLevelGrowthAccounting
Deserialize a JSON object to an instance of FunctionLevelGrowthAccounting.
-
.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(function:, date:, active:, new:, retained:, resurrected:, churned:, additional_properties: nil) ⇒ NewDemoApiClient::FunctionLevelGrowthAccounting constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of FunctionLevelGrowthAccounting to a JSON object.
Constructor Details
#initialize(function:, date:, active:, new:, retained:, resurrected:, churned:, additional_properties: nil) ⇒ NewDemoApiClient::FunctionLevelGrowthAccounting
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/test_sdk/types/function_level_growth_accounting.rb', line 42 def initialize(function:, date:, active:, new:, retained:, resurrected:, churned:, additional_properties: nil) @function = function @date = date @active = active @new = new @retained = retained @resurrected = resurrected @churned = churned @additional_properties = additional_properties @_field_set = { "function": function, "date": date, "active": active, "new": new, "retained": retained, "resurrected": resurrected, "churned": churned } end |
Instance Attribute Details
#active ⇒ Integer (readonly)
Returns The number of active employees in the function during the period.
16 17 18 |
# File 'lib/test_sdk/types/function_level_growth_accounting.rb', line 16 def active @active end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
26 27 28 |
# File 'lib/test_sdk/types/function_level_growth_accounting.rb', line 26 def additional_properties @additional_properties end |
#churned ⇒ Integer (readonly)
Returns The number of employees who left the function during the period.
24 25 26 |
# File 'lib/test_sdk/types/function_level_growth_accounting.rb', line 24 def churned @churned end |
#date ⇒ String (readonly)
Returns The date of the entry in YYYYQ format.
14 15 16 |
# File 'lib/test_sdk/types/function_level_growth_accounting.rb', line 14 def date @date end |
#function ⇒ String (readonly)
Returns The function or department within the company.
12 13 14 |
# File 'lib/test_sdk/types/function_level_growth_accounting.rb', line 12 def function @function end |
#new ⇒ Integer (readonly)
Returns The number of new employees in the function during the period.
18 19 20 |
# File 'lib/test_sdk/types/function_level_growth_accounting.rb', line 18 def new @new end |
#resurrected ⇒ Integer (readonly)
Returns The number of employees who left and returned to the function.
22 23 24 |
# File 'lib/test_sdk/types/function_level_growth_accounting.rb', line 22 def resurrected @resurrected end |
#retained ⇒ Integer (readonly)
Returns The number of employees retained in the function from the last period.
20 21 22 |
# File 'lib/test_sdk/types/function_level_growth_accounting.rb', line 20 def retained @retained end |
Class Method Details
.from_json(json_object:) ⇒ NewDemoApiClient::FunctionLevelGrowthAccounting
Deserialize a JSON object to an instance of FunctionLevelGrowthAccounting
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/test_sdk/types/function_level_growth_accounting.rb', line 66 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) function = parsed_json["function"] date = parsed_json["date"] active = parsed_json["active"] new = parsed_json["new"] retained = parsed_json["retained"] resurrected = parsed_json["resurrected"] churned = parsed_json["churned"] new( function: function, date: date, active: active, new: new, retained: retained, resurrected: resurrected, churned: churned, 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.
101 102 103 104 105 106 107 108 109 |
# File 'lib/test_sdk/types/function_level_growth_accounting.rb', line 101 def self.validate_raw(obj:) obj.function.is_a?(String) != false || raise("Passed value for field obj.function 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.active.is_a?(Integer) != false || raise("Passed value for field obj.active is not the expected type, validation failed.") obj.new.is_a?(Integer) != false || raise("Passed value for field obj.new is not the expected type, validation failed.") obj.retained.is_a?(Integer) != false || raise("Passed value for field obj.retained is not the expected type, validation failed.") obj.resurrected.is_a?(Integer) != false || raise("Passed value for field obj.resurrected is not the expected type, validation failed.") obj.churned.is_a?(Integer) != false || raise("Passed value for field obj.churned is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of FunctionLevelGrowthAccounting to a JSON object
91 92 93 |
# File 'lib/test_sdk/types/function_level_growth_accounting.rb', line 91 def to_json(*_args) @_field_set&.to_json end |