# Source code for api.alarms.v1.test_helpers.alarm.search_alarms

    def success(function):
        """Mock https://osl-argus-trunk-web1.mnemonic.no/web/api/alarms/v1/alarm/search, respond with HTTP 200"""
        import requests_mock
        from argus_api.helpers.tests import fake_response
        def mock_response(*args, **kwargs):
            with requests_mock.Mocker(real_http=True) as mock:
                mock.register_uri(
                    "POST",
                    r"https://osl-argus-trunk-web1.mnemonic.no/web/api/alarms/v1/alarm/search",
                    status_code=200,
                    json=fake_response({'offset': {'type': 'int', 'name': 'offset'}, 'limit': {'type': 'int', 'name': 'limit'}, 'responseCode': {'type': 'int', 'name': 'responseCode'}, 'count': {'type': 'int', 'name': 'count'}, 'data': {'type': 'list', 'items': {'id': {'type': 'int'}, 'attackCategory': {'id': {'type': 'int'}, 'info': {'type': 'str', 'position': 0, 'description': 'Short information about the category. '}, 'name': {'type': 'str', 'position': 0, 'description': 'Name of the category. '}, 'flags': {'type': 'list', 'position': 0, 'description': 'Flags assigned to the object. ', 'uniqueItems': True, 'items': {'type': 'str', 'enum': ['DISABLED', 'RECONNAISSANCE', 'DELETED']}}}, 'mappings': {'type': 'list', 'position': 0, 'description': 'Signatures mapped to the alarm. ', 'uniqueItems': True, 'items': {'alarm': {'position': 0, 'description': 'Alarm the signature is mapped to (null if not mapped). ', '$ref': '#/definitions/Alarm'}, 'lastUpdatedByUser': {'position': 0, 'description': 'Who updated the mapping last. ', '$ref': '#/definitions/UserInfo'}, 'lastUpdatedTimestamp': {'type': 'int', 'position': 0, 'description': 'When the mapping was last updated. '}, 'comments': {'type': 'list', 'position': 0, 'description': 'Comments added to the mapping. ', 'items': {'timestamp': {'type': 'int', 'position': 0, 'description': 'When the comment was added. '}, 'user': {'position': 0, 'description': 'Who added the comment. ', '$ref': '#/definitions/UserInfo'}, 'comment': {'type': 'str', 'position': 0, 'description': "The comment's text. "}}}, 'mappedTimestamp': {'type': 'int', 'position': 0, 'description': 'When the signature was mapped. '}, 'mappedByUser': {'position': 0, 'description': 'Who mapped the signature. ', '$ref': '#/definitions/UserInfo'}, 'firstTriggeredTimestamp': {'type': 'int', 'position': 0, 'description': 'When the signature was first triggered. '}, 'lastTriggeredTimestamp': {'type': 'int', 'position': 0, 'description': 'When the signature was last triggered. '}, 'triggerAmount': {'type': 'int', 'position': 0, 'description': 'How often the signature was triggered. '}, 'signature': {'type': 'str', 'position': 0, 'description': 'Signature mapped to alarm. '}, 'flags': {'type': 'list', 'position': 0, 'description': 'Flags assigned to the object. ', 'uniqueItems': True, 'items': {'type': 'str', 'enum': ['DELETED', 'DEFAULT_BLOCK', 'SNORT', 'ISS_SIGNATURE']}}}}, 'comments': {'type': 'list', 'position': 0, 'description': 'Comments added to the alarm. ', 'items': {'timestamp': {'type': 'int', 'position': 0, 'description': 'When the comment was added. '}, 'user': {'position': 0, 'description': 'Who added the comment. ', '$ref': '#/definitions/UserInfo'}, 'comment': {'type': 'str', 'position': 0, 'description': "The comment's text. "}}}, 'references': {'type': 'list', 'position': 0, 'description': 'Further references to the alarm. ', 'uniqueItems': True, 'items': {'type': 'str'}}, 'labels': {'type': 'list', 'position': 0, 'description': 'Label assigned to the alarm. ', 'uniqueItems': True, 'items': {'type': 'str'}}, 'info': {'type': 'str', 'position': 0, 'description': 'Verbose information about the alarm. '}, 'description': {'type': 'str', 'position': 0, 'description': 'Short description about the alarm. '}, 'links': {'type': 'list', 'position': 0, 'description': 'Links added to the alarm. ', 'uniqueItems': True, 'items': {'type': 'str'}}, 'createdByUser': {'id': {'type': 'int'}, 'customerID': {'type': 'int'}, 'domain': {'$ref': '#/definitions/DomainInfo'}, 'userName': {'type': 'str'}, 'name': {'type': 'str'}, 'type': 'str', 'options': ['user', 'group']}, 'createdTimestamp': {'type': 'int', 'position': 0, 'description': 'When the alarm was created. '}, 'lastUpdatedByUser': {'id': {'type': 'int'}, 'customerID': {'type': 'int'}, 'domain': {'$ref': '#/definitions/DomainInfo'}, 'userName': {'type': 'str'}, 'name': {'type': 'str'}, 'type': 'str', 'options': ['user', 'group']}, 'lastUpdatedTimestamp': {'type': 'int', 'position': 0, 'description': 'When the alarm was last updated. '}, 'lastCheckedByUser': {'id': {'type': 'int'}, 'customerID': {'type': 'int'}, 'domain': {'$ref': '#/definitions/DomainInfo'}, 'userName': {'type': 'str'}, 'name': {'type': 'str'}, 'type': 'str', 'options': ['user', 'group']}, 'lastCheckTimestamp': {'type': 'int', 'position': 0, 'description': 'When the alarm was last checked. '}, 'nextCheckTimestamp': {'type': 'int', 'position': 0, 'description': 'When the alarm should be checked next. '}, 'flags': {'type': 'list', 'position': 0, 'description': 'Flags assigned to the object. ', 'uniqueItems': True, 'items': {'type': 'str', 'enum': ['DISABLED', 'DELETED']}}}, 'name': 'data'}, 'metaData': {'type': 'dict', 'additionalProperties': {'type': 'dict'}, 'name': 'metaData'}, 'messages': {'type': 'list', 'items': {'message': {'type': 'str'}, 'messageTemplate': {'type': 'str'}, 'type': 'str', 'field': {'type': 'str'}, 'parameter': {'type': 'dict'}, 'timestamp': {'type': 'int'}, 'options': ['FIELD_ERROR', 'ACTION_ERROR', 'WARNING', 'NOTIFICATION', 'INFO']}, 'name': 'messages'}, 'currentPage': {'type': 'int', 'name': 'currentPage'}, 'size': {'type': 'int', 'name': 'size'}})
                )
                return function(*args, **kwargs)
            return mock_response
        return decorator

    def unauthorized(function):
        """Mock https://osl-argus-trunk-web1.mnemonic.no/web/api/alarms/v1/alarm/search, respond with HTTP 401"""
        import requests_mock
        from argus_api.helpers.tests import fake_response
        def mock_response(*args, **kwargs):
            with requests_mock.Mocker(real_http=True) as mock:
                mock.register_uri(
                    "POST",
                    r"https://osl-argus-trunk-web1.mnemonic.no/web/api/alarms/v1/alarm/search",
                    status_code=401,
                    json=None
                )
                return function(*args, **kwargs)
            return mock_response
        return decorator

    def forbidden(function):
        """Mock https://osl-argus-trunk-web1.mnemonic.no/web/api/alarms/v1/alarm/search, respond with HTTP 403"""
        import requests_mock
        from argus_api.helpers.tests import fake_response
        def mock_response(*args, **kwargs):
            with requests_mock.Mocker(real_http=True) as mock:
                mock.register_uri(
                    "POST",
                    r"https://osl-argus-trunk-web1.mnemonic.no/web/api/alarms/v1/alarm/search",
                    status_code=403,
                    json=None
                )
                return function(*args, **kwargs)
            return mock_response
        return decorator

    def not_found(function):
        """Mock https://osl-argus-trunk-web1.mnemonic.no/web/api/alarms/v1/alarm/search, respond with HTTP 404"""
        import requests_mock
        from argus_api.helpers.tests import fake_response
        def mock_response(*args, **kwargs):
            with requests_mock.Mocker(real_http=True) as mock:
                mock.register_uri(
                    "POST",
                    r"https://osl-argus-trunk-web1.mnemonic.no/web/api/alarms/v1/alarm/search",
                    status_code=404,
                    json=None
                )
                return function(*args, **kwargs)
            return mock_response
        return decorator