Module: LinkedinV2::Api::Organizations

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

Constant Summary collapse

ORGANIZATION_ENTITY =
"organization".freeze

Instance Method Summary collapse

Instance Method Details

#add_company_post(**options) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/linkedin_v2/api/organizations.rb', line 32

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

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

#add_company_share(**options) ⇒ Object



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

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

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

#company_brand(identifier:, projection: nil) ⇒ Object



17
18
19
20
21
22
# File 'lib/linkedin_v2/api/organizations.rb', line 17

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

  request(:get, path)
end

#organizations(projection: nil, start: nil, count: nil) ⇒ Object



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

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

  request(:get, path)
end