Class: Teamlab::People
Instance Method Summary
collapse
-
#add_contacts(contacts, user_id) ⇒ Object
-
#add_user(is_visitor, email, firstname, lastname, options = {}) ⇒ Object
-
#change_people_status(status, user_ids) ⇒ Object
-
#change_people_type(type, user_ids) ⇒ Object
-
#delete(*user_ids) ⇒ Object
-
#delete_contacts(user_id, contacts) ⇒ Object
-
#delete_photo(user_id) ⇒ Object
-
#delete_user(user_id) ⇒ Object
-
#filter_people(filters) ⇒ Object
-
#get_people ⇒ Object
-
#get_people_by_search_query(query) ⇒ Object
-
#get_people_by_status(status) ⇒ Object
-
#get_self ⇒ Object
-
#get_user_by_email(email) ⇒ Hash
Return the detailed information about the profile of the user with the email specified in the request.
-
#get_user_by_username(username) ⇒ Object
-
#get_user_photoes(user_id) ⇒ Hash
-
#initialize(config = nil) ⇒ People
constructor
A new instance of People.
-
#join_to_affiliate_programme ⇒ String
Join to affiliate programme.
-
#link_account(profile) ⇒ Object
-
#search_people(query) ⇒ Object
-
#search_with_status(status, query) ⇒ Object
-
#send_delete_instruction ⇒ Void
Send instructions for delete user own profile.
-
#send_invite(*user_ids) ⇒ Object
-
#unlink_account(provider) ⇒ Object
-
#update_contacts(user_id, contacts = {}) ⇒ Object
-
#update_photo(user_id, path) ⇒ Object
-
#update_user(user_id, is_visitor, email, firstname, lastname, options = {}) ⇒ Object
#remove_progress, #start_remove, #terminate_remove
#reassign_progress, #start_reassign_user_data, #terminate_reassign
Constructor Details
#initialize(config = nil) ⇒ People
Returns a new instance of People.
10
11
12
|
# File 'lib/teamlab/modules/people.rb', line 10
def initialize(config = nil)
@request = Teamlab::Request.new(config, 'people')
end
|
Instance Method Details
78
79
80
|
# File 'lib/teamlab/modules/people.rb', line 78
def add_contacts(contacts, user_id)
@request.put([user_id, 'contacts'], contacts: contacts)
end
|
#add_user(is_visitor, email, firstname, lastname, options = {}) ⇒ Object
46
47
48
|
# File 'lib/teamlab/modules/people.rb', line 46
def add_user(is_visitor, email, firstname, lastname, options = {})
@request.post(nil, { isVisitor: is_visitor, email: email, firstname: firstname, lastname: lastname }.merge(options))
end
|
#change_people_status(status, user_ids) ⇒ Object
74
75
76
|
# File 'lib/teamlab/modules/people.rb', line 74
def change_people_status(status, user_ids)
@request.put(['status', status], userIds: user_ids)
end
|
#change_people_type(type, user_ids) ⇒ Object
66
67
68
|
# File 'lib/teamlab/modules/people.rb', line 66
def change_people_type(type, user_ids)
@request.put(['type', type.to_s], userIds: user_ids)
end
|
#delete(*user_ids) ⇒ Object
58
59
60
|
# File 'lib/teamlab/modules/people.rb', line 58
def delete(*user_ids)
@request.put(['delete'], userIds: user_ids.flatten)
end
|
94
95
96
|
# File 'lib/teamlab/modules/people.rb', line 94
def delete_contacts(user_id, contacts)
@request.delete([user_id, 'contacts'], contacts: contacts)
end
|
#delete_photo(user_id) ⇒ Object
90
91
92
|
# File 'lib/teamlab/modules/people.rb', line 90
def delete_photo(user_id)
@request.delete([user_id, 'photo'])
end
|
#delete_user(user_id) ⇒ Object
86
87
88
|
# File 'lib/teamlab/modules/people.rb', line 86
def delete_user(user_id)
@request.delete([user_id])
end
|
#filter_people(filters) ⇒ Object
26
27
28
|
# File 'lib/teamlab/modules/people.rb', line 26
def filter_people(filters)
@request.get(['filter'], filters)
end
|
#get_people ⇒ Object
14
15
16
|
# File 'lib/teamlab/modules/people.rb', line 14
def get_people
@request.get
end
|
#get_people_by_search_query(query) ⇒ Object
38
39
40
|
# File 'lib/teamlab/modules/people.rb', line 38
def get_people_by_search_query(query)
@request.get(['@search', query])
end
|
#get_people_by_status(status) ⇒ Object
34
35
36
|
# File 'lib/teamlab/modules/people.rb', line 34
def get_people_by_status(status)
@request.get(['status', status])
end
|
#get_self ⇒ Object
18
19
20
|
# File 'lib/teamlab/modules/people.rb', line 18
def get_self
@request.get(['@self'])
end
|
#get_user_by_email(email) ⇒ Hash
Return the detailed information about the profile of the user with the email specified in the request
105
106
107
|
# File 'lib/teamlab/modules/people.rb', line 105
def get_user_by_email(email)
@request.get(['email'], email: email)
end
|
#get_user_by_username(username) ⇒ Object
30
31
32
|
# File 'lib/teamlab/modules/people.rb', line 30
def get_user_by_username(username)
@request.get([username.to_s])
end
|
#get_user_photoes(user_id) ⇒ Hash
112
113
114
|
# File 'lib/teamlab/modules/people.rb', line 112
def get_user_photoes(user_id)
@request.get([user_id, 'photo'])
end
|
#join_to_affiliate_programme ⇒ String
Join to affiliate programme
124
125
126
|
# File 'lib/teamlab/modules/people.rb', line 124
def join_to_affiliate_programme
@request.put(%w[self joinaffiliate])
end
|
#link_account(profile) ⇒ Object
82
83
84
|
# File 'lib/teamlab/modules/people.rb', line 82
def link_account(profile)
@request.put([%w[thirdparty linkaccount]], serializedProfile: profile)
end
|
#search_people(query) ⇒ Object
22
23
24
|
# File 'lib/teamlab/modules/people.rb', line 22
def search_people(query)
@request.get(['search'], query: query)
end
|
#search_with_status(status, query) ⇒ Object
42
43
44
|
# File 'lib/teamlab/modules/people.rb', line 42
def search_with_status(status, query)
@request.get(['status', status.to_s, 'search'], query: query.to_s)
end
|
#send_delete_instruction ⇒ Void
Send instructions for delete user own profile
118
119
120
|
# File 'lib/teamlab/modules/people.rb', line 118
def send_delete_instruction
@request.put(%w[self delete])
end
|
#send_invite(*user_ids) ⇒ Object
54
55
56
|
# File 'lib/teamlab/modules/people.rb', line 54
def send_invite(*user_ids)
@request.put(['invite'], userIds: user_ids.flatten)
end
|
#unlink_account(provider) ⇒ Object
98
99
100
|
# File 'lib/teamlab/modules/people.rb', line 98
def unlink_account(provider)
@request.delete([%w[thirdparty unlinkaccount]], provider: provider)
end
|
50
51
52
|
# File 'lib/teamlab/modules/people.rb', line 50
def update_contacts(user_id, contacts = {})
@request.post([user_id, 'contacts'], contacts)
end
|
#update_photo(user_id, path) ⇒ Object
70
71
72
|
# File 'lib/teamlab/modules/people.rb', line 70
def update_photo(user_id, path)
@request.put([user_id.to_s, 'photo'], files: path)
end
|
#update_user(user_id, is_visitor, email, firstname, lastname, options = {}) ⇒ Object
62
63
64
|
# File 'lib/teamlab/modules/people.rb', line 62
def update_user(user_id, is_visitor, email, firstname, lastname, options = {})
@request.put([user_id.to_s], { isVisitor: is_visitor, email: email, firstname: firstname, lastname: lastname }.merge(options))
end
|