Class: Upwork::Api::Routers::Organization::Companies

Inherits:
Object
  • Object
show all
Defined in:
lib/upwork/api/routers/organization/companies.rb

Overview

Companies inside Organization

Constant Summary collapse

ENTRY_POINT =
'api'

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Companies

Init

Arguments:

client: (Client)


26
27
28
29
# File 'lib/upwork/api/routers/organization/companies.rb', line 26

def initialize(client)
  @client = client
  @client.epoint = ENTRY_POINT
end

Instance Method Details

#get_listObject

Get Companies Info



32
33
34
35
# File 'lib/upwork/api/routers/organization/companies.rb', line 32

def get_list
  $LOG.i "running " + __method__.to_s
  @client.get '/hr/v2/companies'
end

#get_specific(company_reference) ⇒ Object

Get Specific Company

Arguments:

company_reference: (String)


41
42
43
44
# File 'lib/upwork/api/routers/organization/companies.rb', line 41

def get_specific(company_reference)
  $LOG.i "running " + __method__.to_s
  @client.get '/hr/v2/companies/' + company_reference
end

#get_teams(company_reference) ⇒ Object

Get Teams in Company

Arguments:

company_reference: (String)


50
51
52
53
# File 'lib/upwork/api/routers/organization/companies.rb', line 50

def get_teams(company_reference)
  $LOG.i "running " + __method__.to_s
  @client.get '/hr/v2/companies/' + company_reference + '/teams'
end

#get_users(company_reference) ⇒ Object

Get Users in Company

Arguments:

company_reference: (String)


59
60
61
62
# File 'lib/upwork/api/routers/organization/companies.rb', line 59

def get_users(company_reference)
  $LOG.i "running " + __method__.to_s
  @client.get '/hr/v2/companies/' + company_reference + '/users'
end