Module: AllPlayers::Groups

Included in:
Client
Defined in:
lib/allplayers/client/groups.rb

Instance Method Summary collapse

Instance Method Details

#group_clone(target_uuid, origin_uuid, groups_above_setting = nil) ⇒ Object



17
18
19
# File 'lib/allplayers/client/groups.rb', line 17

def group_clone(target_uuid, origin_uuid, groups_above_setting = nil)
  post 'groups/' + target_uuid + '/copy/' + origin_uuid, {:groups_above => groups_above_setting}
end

#group_clone_webforms(target_uuid, origin_uuid, create_new = false, user_uuid = nil) ⇒ Object



21
22
23
# File 'lib/allplayers/client/groups.rb', line 21

def group_clone_webforms(target_uuid, origin_uuid, create_new = false, user_uuid = nil)
  post 'groups/' + target_uuid + '/copywebforms/' + origin_uuid, {:new => create_new, :user_uuid => user_uuid}
end

#group_create(title, description, location, categories, more_params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/allplayers/client/groups.rb', line 3

def group_create(title, description, location, categories, more_params = {})
  required_params = {
    :title => title,
    :description => description,
    :location => location,
    :category => categories
  }
  post 'groups', required_params.merge(more_params)
end

#group_delete(group_uuid) ⇒ Object



33
34
35
# File 'lib/allplayers/client/groups.rb', line 33

def group_delete(group_uuid)
  delete 'groups/' + group_uuid.to_s
end

#group_get(group_uuid) ⇒ Object



25
26
27
# File 'lib/allplayers/client/groups.rb', line 25

def group_get(group_uuid)
  get 'groups/' + group_uuid
end

#group_members_list(group_uuid, user_uuid = nil, params = {}) ⇒ Object



41
42
43
44
45
46
47
# File 'lib/allplayers/client/groups.rb', line 41

def group_members_list(group_uuid, user_uuid = nil, params = {})
  if user_uuid.nil?
    get 'groups/' + group_uuid + '/members', params
  else
    get 'groups/' + group_uuid + '/members/' + user_uuid, params
  end
end

#group_roles_list(group_uuid, user_uuid = nil, params = {}) ⇒ Object



53
54
55
56
57
58
59
# File 'lib/allplayers/client/groups.rb', line 53

def group_roles_list(group_uuid, user_uuid = nil, params = {})
  if user_uuid.nil?
    get 'groups/' + group_uuid + '/roles', params
  else
    get 'groups/' + group_uuid + '/roles/' + user_uuid, params
  end
end

#group_search(params = {}) ⇒ Object



29
30
31
# File 'lib/allplayers/client/groups.rb', line 29

def group_search(params = {})
  get 'groups', params
end

#group_set_manager(group_uuid, user_uuid, remove_previous = false) ⇒ Object



13
14
15
# File 'lib/allplayers/client/groups.rb', line 13

def group_set_manager(group_uuid, user_uuid, remove_previous = false)
  post 'groups/' + group_uuid.to_s + '/setmanager/' + user_uuid.to_s, {:remove_previous => remove_previous}
end

#group_subgroups_tree(group_uuid) ⇒ Object



61
62
63
# File 'lib/allplayers/client/groups.rb', line 61

def group_subgroups_tree(group_uuid)
  get 'groups/' + group_uuid + '/subgroups/tree'
end

#group_update(group_uuid, params = {}) ⇒ Object



37
38
39
# File 'lib/allplayers/client/groups.rb', line 37

def group_update(group_uuid, params = {})
  put 'groups/' + group_uuid, params
end

#group_webforms_list(group_uuid) ⇒ Object



49
50
51
# File 'lib/allplayers/client/groups.rb', line 49

def group_webforms_list(group_uuid)
  get 'groups/' + group_uuid + '/webforms'
end

#set_store_payee(group_uuid, payee = nil) ⇒ Object



65
66
67
# File 'lib/allplayers/client/groups.rb', line 65

def set_store_payee(group_uuid, payee = nil)
  post 'group_stores/' + group_uuid + '/payee', {:payee_uuid => payee}
end