symphony.bdk.core.service.user.user_service.UserService#
- class symphony.bdk.core.service.user.user_service.UserService(user_api: symphony.bdk.gen.pod_api.user_api.UserApi, users_api: symphony.bdk.gen.pod_api.users_api.UsersApi, audit_trail_api: symphony.bdk.gen.agent_api.audit_trail_api.AuditTrailApi, system_api: symphony.bdk.gen.pod_api.system_api.SystemApi, auth_session: symphony.bdk.core.auth.auth_session.AuthSession, retry_config: symphony.bdk.core.config.model.bdk_retry_config.BdkRetryConfig)#
Bases:
symphony.bdk.core.service.user.user_service.OboUserService
Service class for managing users
This service is used for retrieving information about a particular user, search users by ids, emails or usernames, perform some action related to user like:
Add or remove roles from a user
Get or update avatar of a user
Get, assign or unassign disclaimer to a user
Get, update feature entitlements of a user
Get, update status of a user
- __init__(user_api: symphony.bdk.gen.pod_api.user_api.UserApi, users_api: symphony.bdk.gen.pod_api.users_api.UsersApi, audit_trail_api: symphony.bdk.gen.agent_api.audit_trail_api.AuditTrailApi, system_api: symphony.bdk.gen.pod_api.system_api.SystemApi, auth_session: symphony.bdk.core.auth.auth_session.AuthSession, retry_config: symphony.bdk.core.config.model.bdk_retry_config.BdkRetryConfig)#
Methods
__init__
(user_api, users_api, ...)add_disclaimer
(user_id, disclaimer_id)Assign disclaimer to a user.
add_role
(user_id, role_id)Add a role to a user.
create
(payload)Create a new user.
follow_user
(follower_ids, user_id)Make a list of users to start following a specific user.
get_avatar
(user_id)Get the url of avatar of a user.
get_delegates
(user_id)Get delegates assigned to a user.
get_disclaimer
(user_id)Get disclaimer assigned to a user.
get_feature_entitlements
(user_id)Get feature entitlements of a user.
get_status
(user_id)Get status of a user.
get_user_detail
(user_id)Retrieve user details of a particular user.
list_all_audit_trail
(start_timestamp[, ...])Returns an asynchronous generation of audit trail of actions performed by a privileged user in a given period of time.
list_all_user_details
([chunk_size, max_number])Retrieve all users in the company (pod).
list_all_user_details_by_filter
(user_filter)Retrieve an asynchronous generator of users in the company (pod) by a filter.
list_all_user_followers
(user_id[, ...])Returns an asynchronous generator of the IDs of users who are followers of a specific user.
list_all_users_following
(user_id[, ...])Returns n asynchronous generator of the IDs of users followed by a given user.
list_audit_trail
(start_timestamp[, ...])Returns audit trail of actions performed by a privileged user in a given period of time.
List all roles in the pod.
list_user_details
([skip, limit])Retrieve all users in the company (pod).
list_user_details_by_filter
(user_filter[, ...])Retrieve a list of users in the company (pod) by a filter.
list_user_followers
(user_id[, limit, ...])Returns the list of followers of a specific user.
list_users_by_emails
(emails[, local, active])Search users by emails.
list_users_by_ids
(user_ids[, local, active])Search users by user ids.
list_users_by_usernames
(usernames[, active])Search users by usernames.
list_users_following
(user_id[, limit, ...])Returns the list of users followed by a specific user.
remove_disclaimer
(user_id)Unassign disclaimer from a user.
remove_role
(user_id, role_id)Remove a role from a user.
search_all_users
(query[, local, chunk_size, ...])Search for users by first name, last name, display name, and email; optionally, filter results by company, title, location, marketCoverage, responsibility, function, or instrument.
search_users
(query[, local, skip, limit])Search for users by first name, last name, display name, and email; optionally, filter results by company, title, location, marketCoverage, responsibility, function, or instrument.
suspend
(user_id[, reason, until])Suspends a user account.
suspend_user
(user_id, user_suspension)Suspends or re-activates (unsuspend) a user account.
unfollow_user
(follower_ids, user_id)Make a list of users to stop following a specific user.
unsuspend
(user_id)Unsuspend (Re-activates) a user account.
update
(user_id, payload)Updates an existing user.
update_avatar
(user_id, image)Update avatar of a user.
update_delegates
(user_id, delegate_user_id, ...)Update delegates assigned to a user.
update_feature_entitlements
(user_id, features)Update feature entitlements of a user.
update_status
(user_id, user_status)Update the status of a user.
- add_disclaimer(user_id: int, disclaimer_id: str) None #
Assign disclaimer to a user. See: Update User Disclaimer
- Parameters
user_id – User id
disclaimer_id – Disclaimer to be assigned
- add_role(user_id: int, role_id: symphony.bdk.core.service.user.model.role_id.RoleId) None #
Add a role to a user. See: Add Role
- Parameters
user_id – user id
role_id – role id
- create(payload: symphony.bdk.gen.pod_model.v2_user_create.V2UserCreate) symphony.bdk.gen.pod_model.v2_user_detail.V2UserDetail #
Create a new user. See: Create User v2
- Parameters
payload – User’s details to create.
- Returns
Created user details.
- follow_user(follower_ids: [<class 'int'>], user_id: int) None #
Make a list of users to start following a specific user. See: Follow User
- Parameters
follower_ids – List of the ids of the followers.
user_id – The id of the user to be followed.
- get_avatar(user_id: int) [<class 'symphony.bdk.gen.pod_model.avatar.Avatar'>] #
Get the url of avatar of a user. See: User Avatar
- Parameters
user_id – User id
- Returns
List of avatar urls of the user
- get_delegates(user_id: int) [<class 'int'>] #
Get delegates assigned to a user. See: User Delegates
- Parameters
user_id – User id.
- Returns
List of delegates assigned to a user.
- get_disclaimer(user_id: int) symphony.bdk.gen.pod_model.disclaimer.Disclaimer #
Get disclaimer assigned to a user. See: User Disclaimer
- Parameters
user_id – user id
- Returns
Disclaimer assigned to the user.
- get_feature_entitlements(user_id: int) [<class 'symphony.bdk.gen.pod_model.feature.Feature'>] #
Get feature entitlements of a user. See: User Features
- Parameters
user_id – User id.
- Returns
List of feature entitlements of the user.
- get_status(user_id: int) symphony.bdk.gen.pod_model.user_status.UserStatus #
Get status of a user. See: User Status
- Parameters
user_id – User id.
- Returns
Status of the user.
- get_user_detail(user_id: int) symphony.bdk.gen.pod_model.v2_user_detail.V2UserDetail #
Retrieve user details of a particular user. See: ‘Get User v2 <https://developers.symphony.com/restapi/reference/get-user-v2>’_
- Parameters
user_id – User Id
- Returns
Details of the user.
- async list_all_audit_trail(start_timestamp: int, end_timestamp: Optional[int] = None, initiator_id: Optional[int] = None, role: Optional[symphony.bdk.core.service.user.model.role_id.RoleId] = None, chunk_size: int = 100, max_number: Optional[int] = None) AsyncGenerator[symphony.bdk.gen.agent_model.v1_audit_trail_initiator_list.V1AuditTrailInitiatorList, None] #
Returns an asynchronous generation of audit trail of actions performed by a privileged user in a given period of time. See: List Audit Trail v1
- Parameters
start_timestamp – The start time of the period to retrieve the data.
end_timestamp – The end time of the period to retrieve the data.
initiator_id – The range and limit for pagination of data.
role – Role to list audit trail for.
chunk_size – This is the maximum number of audit trails to return in one HTTP call. Default: 100.
max_number – The total maximum number of audit trails to retrieve. If set to None, we retrieve all audit trails until the last page.
- Returns
An async generator of audit trail.
- async list_all_user_details(chunk_size: int = 50, max_number: Optional[int] = None) AsyncGenerator[symphony.bdk.gen.pod_model.v2_user_detail.V2UserDetail, None] #
Retrieve all users in the company (pod). Same as
list_user_details()
but returns an asynchronous generator which performs the paginated calls with the correct skip and limit values. See: ‘List Users V2 <https://developers.symphony.com/restapi/reference/list-users-v2>’_- Parameters
chunk_size – the maximum number of elements to retrieve in one underlying HTTP call
max_number – the total maximum number of elements to retrieve. If set to None, we retrieve all elements until the last page
- Returns
an asynchronous generator of user details
- async list_all_user_details_by_filter(user_filter: symphony.bdk.gen.pod_model.user_filter.UserFilter, chunk_size: int = 50, max_number: Optional[int] = None) AsyncGenerator[symphony.bdk.gen.pod_model.v2_user_detail.V2UserDetail, None] #
Retrieve an asynchronous generator of users in the company (pod) by a filter. Same as
list_user_details_by_filter()
but returns an generator which performs the paginated calls with the correct skip and limit values. See: Find Users V1- Parameters
user_filter – Filter using to filter users by.
chunk_size – the maximum number of elements to retrieve in one underlying HTTP call
max_number – the total maximum number of elements to retrieve. If set to None, we retrieve all elements until the last page.
- Returns
an asynchronous generator of user details
- async list_all_user_followers(user_id: int, chunk_size: int = 100, max_number: Optional[int] = None) AsyncGenerator[int, None] #
Returns an asynchronous generator of the IDs of users who are followers of a specific user. See: List User Followers
- Parameters
user_id – the id of the user.
chunk_size – the maximum number of followers to return in one HTTP call. Default: 100.
max_number – the total maximum number of elements to retrieve. If set to None, we retrieve all follower users until the last page.
- Returns
an async generator of the user IDs who are followers of a specific user.
- async list_all_users_following(user_id: int, chunk_size: int = 100, max_number: Optional[int] = None) AsyncGenerator[int, None] #
Returns n asynchronous generator of the IDs of users followed by a given user. See: List Users Followed
- Parameters
user_id – the user ID
chunk_size – the maximum number of followers to return in one HTTP call. Default: 100.
max_number – the total maximum number of elements to retrieve. If set to None, we retrieve all following users until the last page.
- Returns
an async generator of the IDs of users followed by a given user.
- list_audit_trail(start_timestamp: int, end_timestamp: int = None, initiator_id: int = None, role: symphony.bdk.core.service.user.model.role_id.RoleId = None, limit: int = 50, before: int = None, after: int = None) symphony.bdk.gen.agent_model.v1_audit_trail_initiator_list.V1AuditTrailInitiatorList #
Returns audit trail of actions performed by a privileged user in a given period of time. See: List Audit Trail v1
- Parameters
start_timestamp – The start time of the period to retrieve the data.
end_timestamp – The end time of the period to retrieve the data.
initiator_id – The range and limit for pagination of data.
role – Role to list audit trail for.
limit – Maximum number of audit trail to return. Default: 50
before – Returns results from an opaque “before” cursor value as presented via a response cursor.
after – Returns results from an opaque “after” cursor value as presented via a response cursor.
- Returns
List of audit trail initiator.
- list_roles() [<class 'symphony.bdk.gen.pod_model.role_detail.RoleDetail'>] #
List all roles in the pod. See: List Roles
- Returns
List of all roles details in the pod.
- list_user_details(skip: int = 0, limit: int = 50) [<class 'symphony.bdk.gen.pod_model.v2_user_detail.V2UserDetail'>] #
Retrieve all users in the company (pod). See: ‘List Users V2 <https://developers.symphony.com/restapi/reference/list-users-v2>’_
- Parameters
skip – Number of users to skip. Default: 0
limit – Maximum number of users to return. Default: 50
- Returns
List of details of all users in the company.
- list_user_details_by_filter(user_filter: symphony.bdk.gen.pod_model.user_filter.UserFilter, skip: int = 0, limit: int = 50) [<class 'symphony.bdk.gen.pod_model.v2_user_detail.V2UserDetail'>] #
Retrieve a list of users in the company (pod) by a filter. See: Find Users V1
- Parameters
user_filter – Filter using to filter users by.
skip – Number of users to skip. Default: 0
limit – Maximum number of users to return. Default: 50
- Returns
List of retrieved users.
- list_user_followers(user_id: int, limit: int = 100, before: str = None, after: str = None) symphony.bdk.gen.pod_model.followers_list_response.FollowersListResponse #
Returns the list of followers of a specific user. See: List User Followers
- Parameters
user_id – User id.
limit – Maximum number of followers to return. Default: 100
before – Returns results from an opaque “before” cursor value as presented via a response cursor.
after – Returns results from an opaque “after” cursor value as presented via a response cursor.
- Returns
List of followers of a specific user.
- list_users_by_emails(emails: [<class 'str'>], local: bool = False, active: bool = None) symphony.bdk.gen.pod_model.v2_user_list.V2UserList #
Search users by emails. See : Users Lookup v3
- Parameters
emails – List of emails.
local – If true then a local DB search will be performed and only local pod users will be returned. If absent or false then a directory search will be performed and users from other pods who are visible to the calling user will also be returned.
active – If not set all user status will be returned, if true all active users will be returned, if false all inactive users will be returned.
- Returns
Users found by emails.
- list_users_by_ids(user_ids: [<class 'int'>], local: bool = False, active: bool = None) symphony.bdk.gen.pod_model.v2_user_list.V2UserList #
Search users by user ids. See : Users Lookup v3
- Parameters
user_ids – List of user ids.
local – If true then a local DB search will be performed and only local pod users will be returned. If absent or false then a directory search will be performed and users from other pods who are visible to the calling user will also be returned.
active – If not set all user status will be returned, if true all active users will be returned, if false all inactive users will be returned.
- Returns
Users found by user ids.
- list_users_by_usernames(usernames: [<class 'str'>], active: bool = None) symphony.bdk.gen.pod_model.v2_user_list.V2UserList #
Search users by usernames. See : Users Lookup v3
- Parameters
usernames – List of usernames.
active – If not set all user status will be returned, if true all active users will be returned, if false all inactive users will be returned.
- Returns
Users found by usernames.
- list_users_following(user_id: int, limit: int = 100, before: str = None, after: str = None) symphony.bdk.gen.pod_model.following_list_response.FollowingListResponse #
Returns the list of users followed by a specific user. See: List Users Followed
- Parameters
user_id – User id.
limit – Maximum number of users to return. Default: 100
before – Returns results from an opaque “before” cursor value as presented via a response cursor.
after – Returns results from an opaque “after” cursor value as presented via a response cursor.
- Returns
The list of users followed by a specific user.
- remove_disclaimer(user_id: int) None #
Unassign disclaimer from a user. See: Unassign User Disclaimer
- Parameters
user_id – user id
- remove_role(user_id: int, role_id: symphony.bdk.core.service.user.model.role_id.RoleId) None #
Remove a role from a user. See: Remove Role
- Parameters
user_id – user id
role_id – role id
- async search_all_users(query: symphony.bdk.gen.pod_model.user_search_query.UserSearchQuery, local: bool = False, chunk_size: int = 50, max_number: Optional[int] = None) AsyncGenerator[symphony.bdk.gen.pod_model.user_v2.UserV2, None] #
Search for users by first name, last name, display name, and email; optionally, filter results by company, title, location, marketCoverage, responsibility, function, or instrument.
Same as
search_users()
but returns an asynchronous generator which performs the paginated calls with the correct skip and limit values. See: Search Users- Parameters
query – Searching query containing complex information like title, location, company…
local – If true then a local DB search will be performed and only local pod users will be returned. If absent or false then a directory search will be performed and users from other pods who are visible to the calling user will also be returned.
chunk_size – the maximum number of elements to retrieve in one underlying HTTP call
max_number – the total maximum number of elements to retrieve
- Returns
an asynchronous generator of users
- search_users(query: symphony.bdk.gen.pod_model.user_search_query.UserSearchQuery, local: bool = False, skip: int = 0, limit: int = 50) symphony.bdk.gen.pod_model.user_search_results.UserSearchResults #
Search for users by first name, last name, display name, and email; optionally, filter results by company, title, location, marketCoverage, responsibility, function, or instrument. See: Search Users
- Parameters
query – Searching query containing complex information like title, location, company…
local – If true then a local DB search will be performed and only local pod users will be returned. If absent or false then a directory search will be performed and users from other pods who are visible to the calling user will also be returned.
skip – Number of users to skip. Default: 0
limit – Maximum number of users to return. Default: 50
- Returns
the list of users found by query.
- suspend(user_id: int, reason: str = None, until: int = None) None #
Suspends a user account. Calling this endpoint requires a service account with the User Provisioning role. See: Suspend User Account v1
- Parameters
user_id – User id to suspend
reason – Reason why the user has to be suspended
until – Time till when the user should be suspended in millis
- suspend_user(user_id: int, user_suspension: symphony.bdk.gen.pod_model.user_suspension.UserSuspension) None #
Suspends or re-activates (unsuspend) a user account. See: Suspend User Account v1
- Parameters
user_id – User id.
user_suspension – User suspension payload.
- unfollow_user(follower_ids: [<class 'int'>], user_id: int) None #
Make a list of users to stop following a specific user. See: Unfollow User
- Parameters
follower_ids – List of the ids of the followers.
user_id – The id of the user to be unfollowed.
- unsuspend(user_id: int) None #
Unsuspend (Re-activates) a user account. Calling this endpoint requires a service account with the User Provisioning role. See: Suspend User Account v1
- Parameters
user_id – user id to reactivate
- update(user_id: int, payload: symphony.bdk.gen.pod_model.v2_user_attributes.V2UserAttributes) symphony.bdk.gen.pod_model.v2_user_detail.V2UserDetail #
Updates an existing user. See: Update User v2
- Parameters
user_id – User Id
payload – User’s new attributes for update.
- Returns
User with the updated user details.
- update_avatar(user_id: int, image: Union[str, bytes]) None #
Update avatar of a user. See: Update User Avatar
- Parameters
user_id – User id
image – The avatar image for the user profile picture. The image must be a base64-encoded string or a bytes array.
- update_delegates(user_id: int, delegate_user_id: int, action: symphony.bdk.core.service.user.model.delegate_action_enum.DelegateActionEnum) None #
Update delegates assigned to a user. See: Update User Delegates
- Parameters
user_id – User id.
delegate_user_id – Delegated user Id to be assigned
action – Action to be performed
- update_feature_entitlements(user_id: int, features: [<class 'symphony.bdk.gen.pod_model.feature.Feature'>]) None #
Update feature entitlements of a user. See: Update User Features
- Parameters
user_id – User id.
features – List of feature entitlements to be updated
- update_status(user_id: int, user_status: symphony.bdk.gen.pod_model.user_status.UserStatus) None #
Update the status of a user. See: Update User Status
- Parameters
user_id – User id.
user_status – Status to be updated to the user.