gws_core

Introduction
Getting Started
Developer guide
Release
Architecture
CLI
Technical documentations
Version

SpaceService

Attributes
AUTH_API_KEY_HEADER_PREFIX: strAUTH_HEADER_KEY: strUSER_ID_HEADER_KEY: str
Functions
__init__

Constructor of the SpaceService

access_token : Optional
if access token is provided, it is used to authenticate. Otherwise the current user is used for authentication
add_or_replace_tags_on_object

Add or replace tags on a folder object in space. The tags are created if they don't exist. If a tag with the same key exists, it is replaced by the new tag.

entity_id : str
id of the object (folder, scenario, document, note, resource...)
tags : List
list of tags to add or replace
Return type : List
add_tags_to_object

Add tags to a folder object in space. The tags are created if they don't exist. It does not replace tags with the same key (use add_or_replace_tags_on_object for that).

entity_id : str
id of the object (folder, scenario, document, note, resource...)
tags : List
list of tags to add
Return type : List
check_2_fa

Check the credential of an email/password by calling space and return true if ok

credentials : UserCredentials2Fa
Return type : UserSpace
check_api_key
api_key : str
Return type : bool
check_credentials

Check the credential of an email/password by calling space, with 2Fa if needed

credentials : UserCredentialsDTO
for_login : bool - True
Return type : ExternalCheckCredentialResponse
create_child_folder

Create a child folder in the lab space.

parent_id : str
id of the parent folder
folder : ExternalSpaceCreateFolder
folder information
Return type : ExternalSpaceFolder
create_root_folder

Create a root folder in the lab space. The root folder will be shared to the current user and mark as created by the current user.

folder : ExternalSpaceCreateFolder
folder information
Return type : ExternalSpaceFolder
delete_note
folder_id : str
note_id : str
delete_scenario
folder_id : str
scenario_id : str
delete_tags_on_object

Delete tags on a folder object in space.

entity_id : str
id of the object (folder, scenario, document, note, resource...)
tags : List
list of tags to delete
get_all_current_user_root_folders

Get all the root folders accessible by the current user

Return type : List
get_all_lab_root_folders

Get all the folder trees (from root) accessible by the lab

Return type : ExternalSpaceFolders
get_all_lab_users

Get all the users of the lab

Return type : List
get_lab_root_folder

Get the root folder tree information. The folder must be accessible by the lab.

id_ : str
id of the root folder
Return type : ExternalSpaceFolder
get_modifications
old_content : RichTextDTO
new_content : RichTextDTO
old_modifications : Optional
Return type : RichTextModificationsDTO
get_synced_notes

Get the list of notes synced with space

Return type : List
get_synced_scenarios

Get the list of scenarios synced with space

Return type : List
get_undo_content
content : RichTextDTO
modifications : RichTextModificationsDTO
modification_id : str
Return type : RichTextDTO
get_user_info

Get the information of a user. The user must be in the same space as the lab.

user_id : str
id of the user
Return type : UserFullDTO
register_lab_start

Call the space api to mark the lab as started

lab_config : LabConfigModelDTO
Return type : bool
save_note
folder_id : str
note : SaveNoteToSpaceDTO
form_data : FormData
Return type : SpaceHierarchyObjectDTO
save_scenario
folder_id : str
save_scenario_dto : SaveScenarioToSpaceDTO
Return type : SpaceHierarchyObjectDTO
send_mail

Send a mail to a list of users. To send a custom mail, use the template 'generic' and provide mail content in the data.

send_mail_dto : SpaceSendMailToUsersDTO
mail information
Return type : Response
send_mail_to_mails

Send a mail to a list of mails. To send a custom mail, use the template 'generic' and provide mail content in the data.

send_mail_to_mails_dto : SpaceSendMailToMailsDTO
mail information
Return type : Response
send_notification

Send a notification to a list of users in a space

send_notification_dto : SpaceSendNotificationDTO
notification information
Return type : Response
share_resource

Share a resource in a folder in space. Only the resource link is shared, not the resource itself. After this, the resource is available in the space folder if this lab is up and running.

folder_id : str
resource_dto : ShareResourceWithSpaceDTO
_description_
Return type : SpaceHierarchyObjectDTO
share_root_folder

Share a root folder with a group

root_folder_id : str
id of the root folder
group_id : str
id of the group (can be a user id or a team id)
role : SpaceRootFolderUserRole - SpaceRootFolderUserRole.USER
share_root_folder_with_current_lab

Share a root folder with the current lab

root_folder_id : str
id of the root folder
Return type : ExternalSpaceFolder
update_folder

Update a folder in the lab space.

folder_id : str
id of the folder
folder : ExternalSpaceCreateFolder
folder information
Return type : ExternalSpaceFolder
update_note_folder
current_folder_id : str
note_id : str
new_folder_id : str
update_scenario_folder
current_folder_id : str
scenario_id : str
new_folder_id : str
create_with_access_token @classmethod

Return a new instance of the SpaceService that use the access token for authentication

Return type : SpaceServiceBaseType
get_instance @classmethod

Return a new instance of the SpaceService that use the current user for authentication

Return type : SpaceServiceBaseType