Class: Teamlab::Settings

Inherits:
Object
  • Object
show all
Defined in:
lib/teamlab/modules/settings.rb

Instance Method Summary collapse

Constructor Details

#initializeSettings

Returns a new instance of Settings.



3
4
5
# File 'lib/teamlab/modules/settings.rb', line 3

def initialize
  @request = Teamlab::Request.new('settings')
end

Instance Method Details

#get_admin_security(product_id, user_id) ⇒ Object



43
44
45
# File 'lib/teamlab/modules/settings.rb', line 43

def get_admin_security(product_id, user_id)
  @request.get(%w(security administrator), productid: product_id, userid: user_id)
end

#get_ip_restrictionsObject



35
36
37
# File 'lib/teamlab/modules/settings.rb', line 35

def get_ip_restrictions
  @request.get(%w(iprestrictions))
end

#get_ldap_settingsObject



15
16
17
# File 'lib/teamlab/modules/settings.rb', line 15

def get_ldap_settings
  @request.get(%w(LDAP))
end

#get_logoObject



19
20
21
# File 'lib/teamlab/modules/settings.rb', line 19

def 
  @request.get(%w(logo))
end

#get_product_admin(product_id) ⇒ Object



47
48
49
# File 'lib/teamlab/modules/settings.rb', line 47

def get_product_admin(product_id)
  @request.get(['security', 'administrator', product_id.to_s])
end

#get_security(ids = []) ⇒ Object



31
32
33
# File 'lib/teamlab/modules/settings.rb', line 31

def get_security(ids = [])
  @request.get(%w(security), ids: ids)
end

#get_settingsObject



7
8
9
# File 'lib/teamlab/modules/settings.rb', line 7

def get_settings
  @request.get
end

#get_sso_settingsObject



11
12
13
# File 'lib/teamlab/modules/settings.rb', line 11

def get_sso_settings
  @request.get(%w(SSO))
end

#get_usage_quotaObject



23
24
25
# File 'lib/teamlab/modules/settings.rb', line 23

def get_usage_quota
  @request.get(%w(quota))
end

#get_versionObject



27
28
29
# File 'lib/teamlab/modules/settings.rb', line 27

def get_version
  @request.get(%w(version))
end

#get_white_label_sizesObject



39
40
41
# File 'lib/teamlab/modules/settings.rb', line 39

def get_white_label_sizes
  @request.get(%w(whitelabel sizes))
end

#save_ip_restrictions(ips) ⇒ Object



67
68
69
# File 'lib/teamlab/modules/settings.rb', line 67

def save_ip_restrictions(ips)
  @request.put(%w(iprestrictions), ips: ips)
end

#set_access(id, enabled = true) ⇒ Object



71
72
73
# File 'lib/teamlab/modules/settings.rb', line 71

def set_access(id, enabled = true)
  @request.put(%w(security access), items: [{ key: id, value: enabled }])
end

#set_product_admin(product_id, user_id, administrator = true) ⇒ Object



75
76
77
# File 'lib/teamlab/modules/settings.rb', line 75

def set_product_admin(product_id, user_id, administrator = true)
  @request.put(%w(security administrator), productid: product_id, userid: user_id, administrator: administrator)
end

#set_security(id, options = {}) ⇒ Object



63
64
65
# File 'lib/teamlab/modules/settings.rb', line 63

def set_security(id, options = {})
  @request.put(%w(security), { id: id }.merge(options))
end

#set_version(version_id) ⇒ Object



59
60
61
# File 'lib/teamlab/modules/settings.rb', line 59

def set_version(version_id)
  @request.put(%w(version), versionId: version_id)
end

#sms_settings(enable) ⇒ Object



51
52
53
# File 'lib/teamlab/modules/settings.rb', line 51

def sms_settings(enable)
  @request.put(%w(sms), enable: enable)
end

#update_ip_restrictions(enable) ⇒ Object



79
80
81
# File 'lib/teamlab/modules/settings.rb', line 79

def update_ip_restrictions(enable)
  @request.put(%w(iprestrictions settings), enable: enable)
end

#update_tips(show) ⇒ Object



55
56
57
# File 'lib/teamlab/modules/settings.rb', line 55

def update_tips(show)
  @request.put(%w(tips), show: show)
end