Class: NewDemoApiClient::ExecutiveProfilePosition

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(company_name: OMIT, is_target_company: OMIT, title: OMIT, start_date: OMIT, end_date: OMIT, additional_properties: nil) ⇒ NewDemoApiClient::ExecutiveProfilePosition

Parameters:

  • company_name (String) (defaults to: OMIT)

    The name of the company where a position was or is held.

  • is_target_company (Boolean) (defaults to: OMIT)

    Whether the company is the same as the company associated with the deal.

  • title (String) (defaults to: OMIT)

    The title of the position held at the company.

  • start_date (String) (defaults to: OMIT)

    The start date of the position.

  • end_date (String) (defaults to: OMIT)

    The end date of the position. If the position is current, this field is null.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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_nameString (readonly)

Returns The name of the company where a position was or is held.

Returns:

  • (String)

    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_dateString (readonly)

Returns The end date of the position. If the position is current, this field is null.

Returns:

  • (String)

    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_companyBoolean (readonly)

Returns Whether the company is the same as the company associated with the deal.

Returns:

  • (Boolean)

    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_dateString (readonly)

Returns The start date of the position.

Returns:

  • (String)

    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

#titleString (readonly)

Returns The title of the position held at the company.

Returns:

  • (String)

    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

Parameters:

  • json_object (String)

Returns:



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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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

Returns:

  • (String)


79
80
81
# File 'lib/test_sdk/types/executive_profile_position.rb', line 79

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