Class: LeanMicrosoftGraph::Resources::UsersResource

Inherits:
LeanMicrosoftGraph::Resource show all
Defined in:
lib/lean_microsoft_graph/resources/users_resource.rb,
lib/lean_microsoft_graph/resources/users_resource/user.rb,
lib/lean_microsoft_graph/resources/users_resource/users.rb

Defined Under Namespace

Classes: User, Users

Instance Method Summary collapse

Methods inherited from LeanMicrosoftGraph::Resource

#get_request, #initialize, #post_request

Constructor Details

This class inherits a constructor from LeanMicrosoftGraph::Resource

Instance Method Details

#countObject



6
7
8
9
10
# File 'lib/lean_microsoft_graph/resources/users_resource.rb', line 6

def count
  get_request('users/$count') do |req|
    req.headers['ConsistencyLevel'] = 'eventual'
  end
end

#get_all(per_page) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/lean_microsoft_graph/resources/users_resource.rb', line 12

def get_all(per_page)
  response = get_request('users') do |req|
    req.params['$top'] = per_page
  end

  Users.new(response)
end

#get_all_by_reference(url) ⇒ Object



20
21
22
23
24
# File 'lib/lean_microsoft_graph/resources/users_resource.rb', line 20

def get_all_by_reference(url)
  response = get_request(url)

  Users.new(response)
end

#get_user_by_id(user_id) ⇒ Object



26
27
28
29
30
# File 'lib/lean_microsoft_graph/resources/users_resource.rb', line 26

def get_user_by_id(user_id)
  response = get_request("users/#{user_id}")

  User.new(response)
end