Class: NewDemoApiClient::EndpointSeniorityCount
- Inherits:
-
Object
- Object
- NewDemoApiClient::EndpointSeniorityCount
- Defined in:
- lib/test_sdk/types/endpoint_seniority_count.rb
Overview
The count of employees at each seniority level at the company
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#count ⇒ Integer
readonly
The count of employees at the seniority level.
-
#seniority ⇒ String
readonly
The seniority level of the employee.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ NewDemoApiClient::EndpointSeniorityCount
Deserialize a JSON object to an instance of EndpointSeniorityCount.
-
.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(seniority:, count:, additional_properties: nil) ⇒ NewDemoApiClient::EndpointSeniorityCount constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of EndpointSeniorityCount to a JSON object.
Constructor Details
#initialize(seniority:, count:, additional_properties: nil) ⇒ NewDemoApiClient::EndpointSeniorityCount
25 26 27 28 29 30 |
# File 'lib/test_sdk/types/endpoint_seniority_count.rb', line 25 def initialize(seniority:, count:, additional_properties: nil) @seniority = seniority @count = count @additional_properties = additional_properties @_field_set = { "seniority": seniority, "count": count } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
14 15 16 |
# File 'lib/test_sdk/types/endpoint_seniority_count.rb', line 14 def additional_properties @additional_properties end |
#count ⇒ Integer (readonly)
Returns The count of employees at the seniority level.
12 13 14 |
# File 'lib/test_sdk/types/endpoint_seniority_count.rb', line 12 def count @count end |
#seniority ⇒ String (readonly)
Returns The seniority level of the employee.
10 11 12 |
# File 'lib/test_sdk/types/endpoint_seniority_count.rb', line 10 def seniority @seniority end |
Class Method Details
.from_json(json_object:) ⇒ NewDemoApiClient::EndpointSeniorityCount
Deserialize a JSON object to an instance of EndpointSeniorityCount
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/test_sdk/types/endpoint_seniority_count.rb', line 36 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) seniority = parsed_json["seniority"] count = parsed_json["count"] new( seniority: seniority, count: count, 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.
61 62 63 64 |
# File 'lib/test_sdk/types/endpoint_seniority_count.rb', line 61 def self.validate_raw(obj:) obj.seniority.is_a?(String) != false || raise("Passed value for field obj.seniority is not the expected type, validation failed.") obj.count.is_a?(Integer) != false || raise("Passed value for field obj.count is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of EndpointSeniorityCount to a JSON object
51 52 53 |
# File 'lib/test_sdk/types/endpoint_seniority_count.rb', line 51 def to_json(*_args) @_field_set&.to_json end |