(
            self, message, date, timestamp_desc, attributes=None,
            tags=None)
return error.get_response_json(response, logger)
Adds an event to the sketch specific timeline.

        Args:
            message: A string that will be used as the message string.
            date: A string with the timestamp of the message. This should be
                in a human readable format, eg: "2020-09-03T22:52:21".
            timestamp_desc : Description of the timestamp.
            attributes: A dict of extra attributes to add to the event.
            tags: A list of strings to include as tags.

        Raises:
            ValueError: If tags is not a list of strings or attributes
                is not a dict.

        Returns:
            Dictionary with query results.
Adds an event to the sketch specific timeline.
Adds an event to the sketch specific timeline .
def add_event(
            self, message, date, timestamp_desc, attributes=None,
            tags=None):
        """Adds an event to the sketch specific timeline.

        Args:
            message: A string that will be used as the message string.
            date: A string with the timestamp of the message. This should be
                in a human readable format, eg: "2020-09-03T22:52:21".
            timestamp_desc : Description of the timestamp.
            attributes: A dict of extra attributes to add to the event.
            tags: A list of strings to include as tags.

        Raises:
            ValueError: If tags is not a list of strings or attributes
                is not a dict.

        Returns:
            Dictionary with query results.
        """
        if self.is_archived():
            raise RuntimeError(
                'Unable to add an event to an archived sketch.')

        if tags is None:
            tags = []

        if not isinstance(tags, list):
            raise ValueError('Tags needs to be a list.')

        if any(not isinstance(tag, str) for tag in tags):
            raise ValueError('Tags needs to be a list of strings.')

        if attributes is None:
            attributes = {}

        if not isinstance(attributes, dict):
            raise ValueError('Attributes needs to be a dict.')

        form_data = {
            'date_string': date,
            'timestamp_desc': timestamp_desc,
            'message': message,
            'tag': tags
        }

        duplicate_attributes = [key for key in attributes if key in form_data]

        if duplicate_attributes:
            duplicates = ', '.join(duplicate_attributes)
            raise ValueError(
                f'Following attributes cannot overwrite values '
                f'already set: {duplicates}')

        form_data['attributes'] = attributes

        resource_url = '{0:s}/sketches/{1:d}/event/create/'.format(
            self.api.api_root, self.id)
        response = self.api.session.post(resource_url, json=form_data)
        return error.get_response_json(response, logger)
def add_event ( self , message , date , timestamp_desc , attributes = None , tags = None ) : if self . is_archived ( ) : raise RuntimeError ( 'Unable to add an event to an archived sketch.' ) if tags is None : tags = [ ] if not isinstance ( tags , list ) : raise ValueError ( 'Tags needs to be a list.' ) if any ( not isinstance ( tag , str ) for tag in tags ) : raise ValueError ( 'Tags needs to be a list of strings.' ) if attributes is None : attributes = { } if not isinstance ( attributes , dict ) : raise ValueError ( 'Attributes needs to be a dict.' ) form_data = { 'date_string' : date , 'timestamp_desc' : timestamp_desc , 'message' : message , 'tag' : tags } duplicate_attributes = [ key for key in attributes if key in form_data ] if duplicate_attributes : duplicates = ', ' . join ( duplicate_attributes ) raise ValueError ( f'Following attributes cannot overwrite values ' f'already set: {duplicates}' ) form_data [ 'attributes' ] = attributes resource_url = '{0:s}/sketches/{1:d}/event/create/' . format ( self . api . api_root , self . id ) response = self . api . session . post ( resource_url , json = form_data ) return error . get_response_json ( response , logger )