# -*- coding: utf-8 -*-

"""Generate the Resilient customizations required for fn_alienvault_otx"""

try:
    from resilient import ImportDefinition
except ImportError:
    # Support Apps running on resilient-circuits < v35.0.195
    from resilient_circuits.util import ImportDefinition


def codegen_reload_data():
    """
    Parameters required reload codegen for the fn_alienvault_otx package
    """
    return {
        "package": u"fn_alienvault_otx",
        "message_destinations": [u"fn_alienvault_otx"],
        "functions": [u"fn_alienvault_otx_threat_lookup"],
        "workflows": [u"example_alien_vault_otx_cve", u"example_alien_vault_otx_url", u"example_alien_vault_otx_dns_name", u"example_alien_vault_otx_ip", u"example_alien_vault_otx_hash", u"example_alien_vault_otx_host_name"],
        "actions": [u"Example: Alien Vault - CVE Lookup", u"Example: Alien Vault - DNS Name Lookup", u"Example: Alien Vault - URL Lookup", u"Example: Alien Vault - File Hash Lookup", u"Example: Alien Vault - IP Address Lookup", u"Example: Alien Vault - Host Name Lookup"],
        "incident_fields": [],
        "incident_artifact_types": [],
        "datatables": [],
        "automatic_tasks": [],
        "scripts": []
    }


def customization_data(client=None):
    """
    Returns a Generator of ImportDefinitions (Customizations).
    Install them using `resilient-circuits customize`

    Contents:
    - Message Destinations:
        - fn_alienvault_otx
    - Functions:
        - fn_alienvault_otx_threat_lookup
    - Workflows:
        - example_alien_vault_otx_cve
        - example_alien_vault_otx_url
        - example_alien_vault_otx_dns_name
        - example_alien_vault_otx_ip
        - example_alien_vault_otx_hash
        - example_alien_vault_otx_host_name
    - Rules:
        - Example: Alien Vault - CVE Lookup
        - Example: Alien Vault - DNS Name Lookup
        - Example: Alien Vault - URL Lookup
        - Example: Alien Vault - File Hash Lookup
        - Example: Alien Vault - IP Address Lookup
        - Example: Alien Vault - Host Name Lookup
    """

    yield ImportDefinition(u"""
<KEY>
""")
