Module: Frontapp::Client::Teammates

Included in:
Frontapp::Client
Defined in:
lib/frontapp/client/teammates.rb

Instance Method Summary collapse

Instance Method Details

#get_teammate(teammate_id) ⇒ Object

Parameters Name Type Description


teammate_id string Id or email of the requested teammate




14
15
16
# File 'lib/frontapp/client/teammates.rb', line 14

def get_teammate(teammate_id)
  get("teammates/#{teammate_id}")
end

#get_teammate_conversations(teammate_id, params = {}) ⇒ Object

Parameters Name Type Description


teammate_id string Id or email of the requested teammate


Allowed params: Name Type Description


q object (optional) Search query. q.statuses array (optional) List of the statuses of the conversations you want to list




50
51
52
53
# File 'lib/frontapp/client/teammates.rb', line 50

def get_teammate_conversations(teammate_id, params = {})
  cleaned = params.permit({ q: [:statuses] })
  list("teammates/#{teammate_id}/conversations", cleaned)
end

#get_teammate_inboxes(teammate_id) ⇒ Object

Parameters Name Type Description


teammate_id string Id or email of the requested teammate




60
61
62
# File 'lib/frontapp/client/teammates.rb', line 60

def get_teammate_inboxes(teammate_id)
  get("teammates/#{teammate_id}/inboxes")
end

#teammates(params = {}) ⇒ Object



5
6
7
# File 'lib/frontapp/client/teammates.rb', line 5

def teammates(params = {})
  list("teammates", params)
end

#update_teammate!(teammate_id, params = {}) ⇒ Object

Parameters Name Type Description


teammate_id string Id or email of the requested teammate


Allowed attributes: Name Type Description


username string (optional) New username. It must be unique and can only contains lowercase letters, numbers and underscores. first_name string (optional) New first name last_name string (optional) New last name is_admin boolean (optional) New admin status is_available boolean (optional) New availability status




33
34
35
36
# File 'lib/frontapp/client/teammates.rb', line 33

def update_teammate!(teammate_id, params = {})
  cleaned = params.permit(:username, :first_name, :last_name, :is_admin, :is_available)
  update("teammates/#{teammate_id}", cleaned)
end