Class: NewDemoApiClient::ExecutiveProfile

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(person_id:, person_name:, profile_url:, positions:, additional_properties: nil) ⇒ NewDemoApiClient::ExecutiveProfile

Parameters:

  • person_id (String)

    The unique LinkedIn profile id for the executive.

  • person_name (String)

    The name of the executive.

  • profile_url (String)

    The URL to the executive’s LinkedIn profile.

  • positions (Array<NewDemoApiClient::ExecutiveProfilePosition>)

    A list of past and present positions held by the executive.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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_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.rb', line 21

def additional_properties
  @additional_properties
end

#person_idString (readonly)

Returns The unique LinkedIn profile id for the executive.

Returns:

  • (String)

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

Returns The name of the executive.

Returns:

  • (String)

    The name of the executive.



15
16
17
# File 'lib/test_sdk/types/executive_profile.rb', line 15

def person_name
  @person_name
end

#positionsArray<NewDemoApiClient::ExecutiveProfilePosition> (readonly)

Returns A list of past and present positions held by the executive.

Returns:



19
20
21
# File 'lib/test_sdk/types/executive_profile.rb', line 19

def positions
  @positions
end

#profile_urlString (readonly)

Returns The URL to the executive’s LinkedIn profile.

Returns:

  • (String)

    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

Parameters:

  • json_object (String)

Returns:



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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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

Returns:

  • (String)


74
75
76
# File 'lib/test_sdk/types/executive_profile.rb', line 74

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