# Source code for api.events.v1.test_helpers.aggregated.find_aggregated_events

    def success(function):
        """Mock https://osl-argus-trunk-web1.mnemonic.no/web/api/events/v1/aggregated/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/events/v1/aggregated/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': {'customerInfo': {'id': {'type': 'int'}, 'name': {'type': 'str'}, 'shortName': {'type': 'str'}, 'domain': {'$ref': '#/definitions/DomainInfo'}}, 'properties': {'type': 'dict', 'additionalProperties': {'type': 'str'}}, 'comments': {'type': 'list', '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. "}}}, 'associatedCase': {'id': {'type': 'int'}, 'description': {'type': 'str'}, 'categoryID': {'type': 'int'}, 'categoryName': {'type': 'str'}, 'service': {'type': 'str'}, 'status': {'type': 'str', 'enum': ['ATTACHMENT_ADDED', 'PENDING_CUSTOMER', 'PENDING_SOC', 'PENDING_VENDOR', 'WORKING_SOC', 'WORKING_CUSTOMER', 'PENDING_CLOSE', 'CLOSED']}, 'priority': {'type': 'str', 'enum': ['low', 'medium', 'high', 'critical']}}, 'location': {'id': {'type': 'int'}, 'shortName': {'type': 'str'}, 'name': {'type': 'str'}, 'timeZone': {'type': 'str'}}, 'attackInfo': {'alarmID': {'type': 'int'}, 'alarmDescription': {'type': 'str'}, 'attackCategoryID': {'type': 'int'}, 'attackCategoryName': {'type': 'str'}, 'signature': {'type': 'str'}}, 'domain': {'fqdn': {'type': 'str'}}, 'uri': {'type': 'str'}, 'count': {'type': 'int'}, 'source': {'port': {'type': 'int'}, 'geoLocation': {'$ref': '#/definitions/GeoInfo'}, 'networkAddress': {'$ref': '#/definitions/IPNetworkAddress'}}, 'destination': {'port': {'type': 'int'}, 'geoLocation': {'$ref': '#/definitions/GeoInfo'}, 'networkAddress': {'$ref': '#/definitions/IPNetworkAddress'}}, 'protocol': {'type': 'str'}, 'timestamp': {'type': 'int'}, 'startTimestamp': {'type': 'int'}, 'endTimestamp': {'type': 'int'}, 'lastUpdatedTimestamp': {'type': 'int'}, 'flags': {'type': 'list', 'uniqueItems': True, 'items': {'type': 'str', 'enum': ['ESTABLISHED', 'BLOCKED', 'SNAPSHOT', 'FINALIZED', 'SOURCE_IS_CUSTOMERNET', 'DESTINATION_IS_CUSTOMERNET', 'SOURCE_IS_PARTIAL_CUSTOMERNET', 'DESTINATION_IS_PARTIAL_CUSTOMERNET', 'INTRUDER_IS_CUSTOMERNET', 'VICTIM_IS_CUSTOMERNET', 'INTRUDER_IS_PARTIAL_CUSTOMERNET', 'VICTIM_IS_PARTIAL_CUSTOMERNET', 'PARTIALLY_BLOCKED', 'FALSE_POSITIVE', 'NOT_A_THREAT', 'TUNING_CANDIDATE', 'NOTIFIED', 'PARTIALLY_NOTIFIED', 'FOLLOWUP', 'IDENTIFIED_THREAT', 'THREAT_CANDIDATE', 'ACKNOWLEDGED', 'PARTIALLY_ACKNOWLEDGED', 'SEVERITY_ADJUSTED', 'COMMENTED', 'FILTERED', 'CHECKED', 'INCOMPLETE_DETAILS', 'AGGREGATED_BASE_EVENT', 'REMOTE_STORAGE', 'CUSTOM_SOURCE_AGGREGATION', 'CUSTOM_DESTINATION_AGGREGATION', 'CUSTOM_INTRUDER_AGGREGATION', 'CUSTOM_VICTIM_AGGREGATION', 'HAS_PAYLOAD', 'HAS_PCAP', 'ASSOCIATED_TO_CASE_BY_FILTER', 'SEVERITY_INCREASED_BY_FILTER', 'SEVERITY_REDUCED_BY_FILTER', 'CREATED_BY_ANALYSIS_FILTER', 'EXTEND_EVENT_TTL', 'INITIAL_TUNING']}}, 'severity': {'type': 'str', 'readOnly': True, 'enum': ['low', 'medium', 'high', 'critical']}, 'detailedEventIDS': {'type': 'list', 'readOnly': True, 'uniqueItems': True, 'items': {'type': 'str'}}, 'id': {'type': 'str', 'xml': {'attribute': True}, 'readOnly': True}}, '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/events/v1/aggregated/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/events/v1/aggregated/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/events/v1/aggregated/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/events/v1/aggregated/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/events/v1/aggregated/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/events/v1/aggregated/search",
                    status_code=404,
                    json=None
                )
                return function(*args, **kwargs)
            return mock_response
        return decorator