Add a KE-chain Script (e.g. script widget) to the customization.

        The widget will be saved to KE-chain.

        :param script: The Script to which the button will be coupled and will be ran when the button is pressed.
        :type script: :class:`Service` or UUID
        :param custom_title: A custom title for the script widget
            * False (default): Script name
            * String value: Custom title
            * None: No title
        :type custom_title: bool or basestring or None
        :param custom_button_text: A custom text for the button linked to the script
            * False (default): Script name
            * String value: Custom title
            * None: No title
        :type custom_button_text: bool or basestring or None
        :param emphasize_run: Emphasize the run button (default True)
        :type emphasize_run: bool
        :param download_log: Include the possibility of downloading the log inside the activity
        :type download_log: bool
        :raises IllegalArgumentError: When unknown or illegal arguments are passed.

def add_script_widget(self, script, custom_title=False, custom_button_text=False, emphasize_run=True,
                          download_log=False):
        """
        Add a KE-chain Script (e.g. script widget) to the customization.

        The widget will be saved to KE-chain.

        :param script: The Script to which the button will be coupled and will be ran when the button is pressed.
        :type script: :class:`Service` or UUID
        :param custom_title: A custom title for the script widget
            * False (default): Script name
            * String value: Custom title
            * None: No title
        :type custom_title: bool or basestring or None
        :param custom_button_text: A custom text for the button linked to the script
            * False (default): Script name
            * String value: Custom title
            * None: No title
        :type custom_button_text: bool or basestring or None
        :param emphasize_run: Emphasize the run button (default True)
        :type emphasize_run: bool
        :param download_log: Include the possibility of downloading the log inside the activity
        :type download_log: bool
        :raises IllegalArgumentError: When unknown or illegal arguments are passed.
        """
        # Check whether the script is uuid type or class `Service`
        if isinstance(script, Service):
            script_id = script.id
        elif isinstance(script, text_type) and is_uuid(script):
            script_id = script
            script = self._client.service(id=script_id)
        else:
            raise IllegalArgumentError("When using the add_script_widget, script must be a Service or Service id. "
                                       "Type is: {}".format(type(script)))
        # Add custom title
        if custom_title is False:
            show_title_value = "Default"
            title = script.name
        elif custom_title is None:
            show_title_value = "No title"
            title = ''
        else:
            show_title_value = "Custom title"
            title = str(custom_title)

        # Add custom button text
        if custom_button_text is False:
            show_button_value = "Default"
            button_text = script.name
        elif custom_button_text is None:
            show_button_value = "No text"
            button_text = ''
        else:
            show_button_value = "Custom text"
            button_text = str(custom_button_text)

        # Declare script widget config
        config = {
            'showTitleValue': show_title_value,
            'serviceId': script_id,
            'viewModel': {
                'data': {
                    'canDowloadLog': download_log,
                    'buttonUI': 'primary-action' if emphasize_run else "default-toolbar"
                }
            },
            'title': title,
            'xtype': ComponentXType.EXECUTESERVICE,
            'customButtonText': button_text
        }

        # Declare script widget meta
        meta = {
            'showButtonValue': show_button_value,
            'customText': button_text,
            'customTitle': title,
            'serviceId': script_id,
            'emphasizeButton': emphasize_run,
            'showTitleValue': show_title_value,
            'showDownloadLog': download_log
        }

        self._add_widget(dict(config=config, meta=meta, name=WidgetNames.SERVICEWIDGET))