Class: NewDemoApiClient::ExecutiveProfile
- Inherits:
-
Object
- Object
- NewDemoApiClient::ExecutiveProfile
- Defined in:
- lib/test_sdk/types/executive_profile.rb
Overview
A list of current executives, at the time the talent was pulled, their roles at
the company, and their prior
positions
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#person_id ⇒ String
readonly
The unique LinkedIn profile id for the executive.
-
#person_name ⇒ String
readonly
The name of the executive.
-
#positions ⇒ Array<NewDemoApiClient::ExecutiveProfilePosition>
readonly
A list of past and present positions held by the executive.
-
#profile_url ⇒ String
readonly
The URL to the executive’s LinkedIn profile.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ NewDemoApiClient::ExecutiveProfile
Deserialize a JSON object to an instance of ExecutiveProfile.
-
.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(person_id:, person_name:, profile_url:, positions:, additional_properties: nil) ⇒ NewDemoApiClient::ExecutiveProfile constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of ExecutiveProfile to a JSON object.
Constructor Details
#initialize(person_id:, person_name:, profile_url:, positions:, additional_properties: nil) ⇒ NewDemoApiClient::ExecutiveProfile
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/test_sdk/types/executive_profile.rb', line 34 def initialize(person_id:, person_name:, profile_url:, positions:, additional_properties: nil) @person_id = person_id @person_name = person_name @profile_url = profile_url @positions = positions @additional_properties = additional_properties @_field_set = { "person_id": person_id, "person_name": person_name, "profile_url": profile_url, "positions": positions } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
21 22 23 |
# File 'lib/test_sdk/types/executive_profile.rb', line 21 def additional_properties @additional_properties end |
#person_id ⇒ String (readonly)
Returns The unique LinkedIn profile id for the executive.
13 14 15 |
# File 'lib/test_sdk/types/executive_profile.rb', line 13 def person_id @person_id end |
#person_name ⇒ String (readonly)
Returns The name of the executive.
15 16 17 |
# File 'lib/test_sdk/types/executive_profile.rb', line 15 def person_name @person_name end |
#positions ⇒ Array<NewDemoApiClient::ExecutiveProfilePosition> (readonly)
Returns A list of past and present positions held by the executive.
19 20 21 |
# File 'lib/test_sdk/types/executive_profile.rb', line 19 def positions @positions end |
#profile_url ⇒ String (readonly)
Returns The URL to the executive’s LinkedIn profile.
17 18 19 |
# File 'lib/test_sdk/types/executive_profile.rb', line 17 def profile_url @profile_url end |
Class Method Details
.from_json(json_object:) ⇒ NewDemoApiClient::ExecutiveProfile
Deserialize a JSON object to an instance of ExecutiveProfile
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/test_sdk/types/executive_profile.rb', line 52 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) person_id = parsed_json["person_id"] person_name = parsed_json["person_name"] profile_url = parsed_json["profile_url"] positions = parsed_json["positions"]&.map do |item| item = item.to_json NewDemoApiClient::ExecutiveProfilePosition.from_json(json_object: item) end new( person_id: person_id, person_name: person_name, profile_url: profile_url, positions: positions, 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.
84 85 86 87 88 89 |
# File 'lib/test_sdk/types/executive_profile.rb', line 84 def self.validate_raw(obj:) obj.person_id.is_a?(String) != false || raise("Passed value for field obj.person_id is not the expected type, validation failed.") obj.person_name.is_a?(String) != false || raise("Passed value for field obj.person_name is not the expected type, validation failed.") obj.profile_url.is_a?(String) != false || raise("Passed value for field obj.profile_url is not the expected type, validation failed.") obj.positions.is_a?(Array) != false || raise("Passed value for field obj.positions is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of ExecutiveProfile to a JSON object
74 75 76 |
# File 'lib/test_sdk/types/executive_profile.rb', line 74 def to_json(*_args) @_field_set&.to_json end |