Module: RubyLokaliseApi::Rest::TeamUsers

Included in:
RubyLokaliseApi::Rest
Defined in:
lib/ruby_lokalise_api/rest/team_users.rb

Instance Method Summary collapse

Instance Method Details

#destroy_team_user(team_id, user_id) ⇒ RubyLokaliseApi::Generics::DeletedResource

Deletes a team user

Parameters:

  • team_id (String, Integer)
  • user_id (String, Integer)

Returns:

See Also:



56
57
58
59
60
61
62
# File 'lib/ruby_lokalise_api/rest/team_users.rb', line 56

def destroy_team_user(team_id, user_id)
  params = { query: [team_id, user_id] }

  data = endpoint(name: 'TeamUsers', params: params).do_delete

  RubyLokaliseApi::Generics::DeletedResource.new data.content
end

#team_user(team_id, user_id) ⇒ RubyLokaliseApi::Resources::TeamUser

Returns a single team user

Parameters:

  • team_id (String, Integer)
  • user_id (String, Integer)

Returns:

See Also:



27
28
29
30
31
32
33
# File 'lib/ruby_lokalise_api/rest/team_users.rb', line 27

def team_user(team_id, user_id)
  params = { query: [team_id, user_id] }

  response = endpoint(name: 'TeamUsers', params: params).do_get

  resource 'TeamUser', response
end

#team_users(team_id, req_params = {}) ⇒ RubyLokaliseApi::Collections::TeamUsers

Returns team users

Parameters:

  • team_id (Integer, String)
  • req_params (Hash) (defaults to: {})

Returns:

See Also:



12
13
14
15
16
17
18
19
# File 'lib/ruby_lokalise_api/rest/team_users.rb', line 12

def team_users(team_id, req_params = {})
  name = 'TeamUsers'
  params = { query: team_id, req: req_params }

  data = endpoint(name: name, params: params).do_get

  collection name, data
end

#update_team_user(team_id, user_id, req_params = {}) ⇒ RubyLokaliseApi::Resources::TeamUser

Updates a team user

Parameters:

  • team_id (String, Integer)
  • user_id (String, Integer)
  • req_params (Hash) (defaults to: {})

Returns:

See Also:



42
43
44
45
46
47
48
# File 'lib/ruby_lokalise_api/rest/team_users.rb', line 42

def update_team_user(team_id, user_id, req_params = {})
  params = { query: [team_id, user_id], req: req_params }

  data = endpoint(name: 'TeamUsers', params: params).do_put

  resource 'TeamUser', data
end