Space¶
-
class
watson_workspace_sdk.models.space.
Space
(id: str = '', created: <module 'datetime' from '/home/docs/.pyenv/versions/3.7.1/lib/python3.7/datetime.py'> = datetime.time(0, 0), created_by=None, updated: <module 'datetime' from '/home/docs/.pyenv/versions/3.7.1/lib/python3.7/datetime.py'> = datetime.time(0, 0), updated_by=None, title='', description='', members=[], members_updated=datetime.time(0, 0), conversation=None)¶ Bases:
object
Basic class that Space functionality.
Attributes
- id : str
- Space Id
- created : datetime
- Space creation date
- created_by : Person
- Person that created the space
- updated : datetime
- Space modification date
- updated_by : Person
- Person who last updated the space
- description : str
- Space description string
- members : List[Person]
- List of space members
- members_updated : datetime
- Memberlist update timestamp
- conversation : str
- Conversation object - may be removed
Methods
-
add_members
(list_of_members_to_add: [<class 'str'>]) → None¶ Adds a list of members to a Space :param: list_of_members_to_add :return: None
-
classmethod
create
(space_title) → watson_workspace_sdk.models.space.Space¶ A simple method to create a space with a provided space title.
Parameters: space_title – Title of the new workspace. Returns: Space Return type: Space
-
delete
() → None¶ A simple method to delete the space.
Returns: None
-
classmethod
get
(space_id) → watson_workspace_sdk.models.space.Space¶ A simple method to populate Conversation object from a space_id
Parameters: space_id – the id of the space to retrieve Returns: Space Return type: Space
-
classmethod
get_from_json
(json_body) → watson_workspace_sdk.models.space.Space¶ Gets a Space object from JSON :param json_body: :return: Space :rtype: Space
-
remove_members
(list_of_members_to_delete: [<class 'str'>]) → None¶ Removes a list of members to a Space :param: list_of_members_to_remove :return: None
-
send_message
(message_to_send: watson_workspace_sdk.models.message.Message) → None¶ Sends a message to a Space :param message_to_send: Message object to send :return: None
-
watson_workspace_sdk.models.space.
parse_members
(members_json) → List[watson_workspace_sdk.models.person.Person]¶ Takes in a JSON Array of members and converts it to a list of Person objects :param members_json: JSON Object :return: A list of Members of a workspace :rtype: List[Person]