Module: LinkedinV2::Api::Profiles

Included in:
Client
Defined in:
lib/linkedin_v2/api/profiles.rb

Constant Summary collapse

PROFILE_ENTITY =
"person".freeze

Instance Method Summary collapse

Instance Method Details

#add_profile_post(**options) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/linkedin_v2/api/profiles.rb', line 23

def add_profile_post(**options)
  attrs = options.merge(entity: PROFILE_ENTITY)
  body = LinkedinV2::Templates::Payloads::UgcPost.new(attrs)
  path = LinkedinV2::Url::Builder.(:ugc_post)

  request(:post, path, body.to_json, post_headers)
end

#add_profile_share(**options) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/linkedin_v2/api/profiles.rb', line 15

def add_profile_share(**options)
  attrs = options.merge(entity: PROFILE_ENTITY)
  body = LinkedinV2::Templates::Payloads::Shares.new(attrs)
  path = LinkedinV2::Url::Builder.(:shares)

  request(:post, path, body.to_json, post_headers)
end

#me(projection: nil) ⇒ Object



8
9
10
11
12
13
# File 'lib/linkedin_v2/api/profiles.rb', line 8

def me(projection: nil)
  params = { projection: projection }
  path = LinkedinV2::Url::Builder.(:me, params)

  request(:get, path)
end