Beispiel #1
0
    def set(
        self,
        key,
        text,
    ):
        """Set.

        :param key: The help key
        :param text: The help text
        """
        request_data = {
            'key': key,
            'text': text,
        }

        errors_mapping = {}
        errors_mapping[('MISSING_FIELDS', None)] = MissingFields(
            'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields'
        )
        errors_mapping[('NOT_SYSADMIN_OR_SUPPORT',
                        None)] = NotSysadminOrSupport(
                            'The user is not a sysadmin or support user')
        query_data = {
            'api': self._api,
            'url': '/help/set',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
Beispiel #2
0
    def template_activate(
        self,
        uuid,
    ):
        """Template activate.

        :param uuid: uuid of the template
        """
        request_data = {
            'uuid': uuid,
        }

        errors_mapping = {}
        errors_mapping[('MISSING_FIELDS', None)] = MissingFields(
            'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields'
        )
        errors_mapping[(
            'NOT_FOUND',
            None)] = NotFound('The radreport template can not be found')
        errors_mapping[('NOT_SYSADMIN_OR_SUPPORT',
                        None)] = NotSysadminOrSupport(
                            'The user is not a sysadmin or support user')
        query_data = {
            'api': self._api,
            'url': '/radreport/template/activate',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
Beispiel #3
0
    def set(
        self,
        language,
        tag,
        value,
        account_id=None,
        vanity=None,
    ):
        """Set.
        :param language: The ISO 639-1 language code
        :param tag: The tag to set
        :param value: The value of the tag. If this is empty the tag is deleted
        :param account_id: The uuid of the account to apply the tag for (optional)
        :param vanity: Vanity to apply the tag for (optional)
        """
        request_data = {
            'value': value,
            'vanity': vanity,
            'language': language,
            'account_id': account_id,
            'tag': tag,
        }

        errors_mapping = {}
        errors_mapping['MISSING_FIELDS'] = MissingFields(
            'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields'
        )
        errors_mapping['NOT_FOUND'] = NotFound('The account was not found')
        errors_mapping['NOT_PERMITTED'] = NotPermitted(
            'The user is not an account administrator  and is trying to set account tags'
        )
        errors_mapping['NOT_SYSADMIN_OR_SUPPORT'] = NotSysadminOrSupport(
            'The user is not a sysadmin or support user and is trying to set global tags'
        )
        errors_mapping['NO_VALUE'] = NoValue(
            'The value parameter was not passed')
        query_data = {
            'api': self._api,
            'url': '/terminology/set',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
Beispiel #4
0
    def template_set(
        self,
        uuid,
        body=None,
        name=None,
        options=None,
        preview=None,
        type=None,
    ):
        """Template set.

        :param uuid: uuid of the template
        :param body: Body of the template (optional)
        :param name: Name of the template (optional)
        :param options: JSON options of the template (optional)
        :param preview: Preview of the template (optional)
        :param type: Type of radreport (optional)
        """
        request_data = {
            'body': body,
            'name': name,
            'options': options,
            'preview': preview,
            'type': type,
            'uuid': uuid,
        }

        errors_mapping = {}
        errors_mapping[('MISSING_FIELDS', None)] = MissingFields(
            'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields'
        )
        errors_mapping[('NOT_SYSADMIN_OR_SUPPORT',
                        None)] = NotSysadminOrSupport(
                            'You are not permitted to perform this operation')
        query_data = {
            'api': self._api,
            'url': '/radreport/template/set',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)
Beispiel #5
0
    def template_add(
        self,
        account_id,
        body,
        name,
        type,
        options=None,
        preview=None,
    ):
        """Template add.

        :param account_id: uuid of the account
        :param body: Body of the template
        :param name: Name of the template
        :param type: Type of radreport
        :param options: JSON options of the template (optional)
        :param preview: Preview of the template (optional)
        """
        request_data = {
            'account_id': account_id,
            'body': body,
            'name': name,
            'options': options,
            'preview': preview,
            'type': type,
        }

        errors_mapping = {}
        errors_mapping[('MISSING_FIELDS', None)] = MissingFields(
            'A required field is missing or does not have data in it. The error_subtype holds a array of all the missing fields'
        )
        errors_mapping[('NOT_SYSADMIN_OR_SUPPORT',
                        None)] = NotSysadminOrSupport(
                            'The user is not a sysadmin or support user')
        query_data = {
            'api': self._api,
            'url': '/radreport/template/add',
            'request_data': request_data,
            'errors_mapping': errors_mapping,
            'required_sid': True,
        }
        return QueryO(**query_data)