Class: NewDemoApiClient::ExecutiveProfilePosition
- Inherits:
-
Object
- Object
- NewDemoApiClient::ExecutiveProfilePosition
- Defined in:
- lib/test_sdk/types/executive_profile_position.rb
Overview
Contains a list of past and present positions held by an executive 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.
-
#company_name ⇒ String
readonly
The name of the company where a position was or is held.
-
#end_date ⇒ String
readonly
The end date of the position.
-
#is_target_company ⇒ Boolean
readonly
Whether the company is the same as the company associated with the deal.
-
#start_date ⇒ String
readonly
The start date of the position.
-
#title ⇒ String
readonly
The title of the position held at the company.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ NewDemoApiClient::ExecutiveProfilePosition
Deserialize a JSON object to an instance of ExecutiveProfilePosition.
-
.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(company_name: OMIT, is_target_company: OMIT, title: OMIT, start_date: OMIT, end_date: OMIT, additional_properties: nil) ⇒ NewDemoApiClient::ExecutiveProfilePosition constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of ExecutiveProfilePosition to a JSON object.
Constructor Details
#initialize(company_name: OMIT, is_target_company: OMIT, title: OMIT, start_date: OMIT, end_date: OMIT, additional_properties: nil) ⇒ NewDemoApiClient::ExecutiveProfilePosition
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/test_sdk/types/executive_profile_position.rb', line 35 def initialize(company_name: OMIT, is_target_company: OMIT, title: OMIT, start_date: OMIT, end_date: OMIT, additional_properties: nil) @company_name = company_name if company_name != OMIT @is_target_company = is_target_company if is_target_company != OMIT @title = title if title != OMIT @start_date = start_date if start_date != OMIT @end_date = end_date if end_date != OMIT @additional_properties = additional_properties @_field_set = { "company_name": company_name, "is_target_company": is_target_company, "title": title, "start_date": start_date, "end_date": end_date }.reject do |_k, v| v == OMIT end 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_position.rb', line 21 def additional_properties @additional_properties end |
#company_name ⇒ String (readonly)
Returns The name of the company where a position was or is held.
11 12 13 |
# File 'lib/test_sdk/types/executive_profile_position.rb', line 11 def company_name @company_name end |
#end_date ⇒ String (readonly)
Returns The end date of the position. If the position is current, this field is null.
19 20 21 |
# File 'lib/test_sdk/types/executive_profile_position.rb', line 19 def end_date @end_date end |
#is_target_company ⇒ Boolean (readonly)
Returns Whether the company is the same as the company associated with the deal.
13 14 15 |
# File 'lib/test_sdk/types/executive_profile_position.rb', line 13 def is_target_company @is_target_company end |
#start_date ⇒ String (readonly)
Returns The start date of the position.
17 18 19 |
# File 'lib/test_sdk/types/executive_profile_position.rb', line 17 def start_date @start_date end |
#title ⇒ String (readonly)
Returns The title of the position held at the company.
15 16 17 |
# File 'lib/test_sdk/types/executive_profile_position.rb', line 15 def title @title end |
Class Method Details
.from_json(json_object:) ⇒ NewDemoApiClient::ExecutiveProfilePosition
Deserialize a JSON object to an instance of ExecutiveProfilePosition
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/test_sdk/types/executive_profile_position.rb', line 58 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) company_name = parsed_json["company_name"] is_target_company = parsed_json["is_target_company"] title = parsed_json["title"] start_date = parsed_json["start_date"] end_date = parsed_json["end_date"] new( company_name: company_name, is_target_company: is_target_company, title: title, start_date: start_date, end_date: end_date, 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.
89 90 91 92 93 94 95 |
# File 'lib/test_sdk/types/executive_profile_position.rb', line 89 def self.validate_raw(obj:) obj.company_name&.is_a?(String) != false || raise("Passed value for field obj.company_name is not the expected type, validation failed.") obj.is_target_company&.is_a?(Boolean) != false || raise("Passed value for field obj.is_target_company is not the expected type, validation failed.") obj.title&.is_a?(String) != false || raise("Passed value for field obj.title is not the expected type, validation failed.") obj.start_date&.is_a?(String) != false || raise("Passed value for field obj.start_date is not the expected type, validation failed.") obj.end_date&.is_a?(String) != false || raise("Passed value for field obj.end_date is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of ExecutiveProfilePosition to a JSON object
79 80 81 |
# File 'lib/test_sdk/types/executive_profile_position.rb', line 79 def to_json(*_args) @_field_set&.to_json end |