<reponame>kennyleeshim1ibmcom/resilient-community-apps
# -*- coding: utf-8 -*-

"""Generate the Resilient customizations required for fn_jira"""

from __future__ import print_function
from resilient_circuits.util import *

def codegen_reload_data():
    """Parameters to codegen used to generate the fn_jira package"""
    reload_params = {"package": u"fn_jira",
                    "incident_fields": [u"jira_internal_url", u"jira_url"], 
                    "action_fields": [], 
                    "function_params": [u"incident_id", u"jira_assignee", u"jira_comment", u"jira_description", u"jira_issuetype", u"jira_priority", u"jira_project", u"jira_resolution", u"jira_summary", u"jira_transition_id", u"jira_url", u"task_id"], 
                    "datatables": [u"jira_task_references"], 
                    "message_destinations": [u"fn_jira"], 
                    "functions": [u"jira_create_comment", u"jira_open_issue", u"jira_transition_issue"], 
                    "phases": [], 
                    "automatic_tasks": [], 
                    "scripts": [], 
                    "workflows": [u"example_jira_open_issue_task", u"jira_create_comment", u"jira_open_issue", u"jira_transition_issue", u"jira_transition_issue_task"], 
                    "actions": [u"Example: Create Jira Issue", u"Example: Create Jira Issue (Task)", u"Example: Jira Close Issue", u"Example: Jira Close Issue (Task)", u"Example: Jira Create Comment"] 
                    }
    return reload_params


def customization_data(client=None):
    """Produce any customization definitions (types, fields, message destinations, etc)
       that should be installed by `resilient-circuits customize`
    """

    # This import data contains:
    #   Incident fields:
    #     jira_internal_url
    #     jira_url
    #   Function inputs:
    #     incident_id
    #     jira_assignee
    #     jira_comment
    #     jira_description
    #     jira_issuetype
    #     jira_priority
    #     jira_project
    #     jira_resolution
    #     jira_summary
    #     jira_transition_id
    #     jira_url
    #     task_id
    #   DataTables:
    #     jira_task_references
    #   Message Destinations:
    #     fn_jira
    #   Functions:
    #     jira_create_comment
    #     jira_open_issue
    #     jira_transition_issue
    #   Workflows:
    #     example_jira_open_issue_task
    #     jira_create_comment
    #     jira_open_issue
    #     jira_transition_issue
    #     jira_transition_issue_task
    #   Rules:
    #     Example: Create Jira Issue
    #     Example: Create Jira Issue (Task)
    #     Example: Jira Close Issue
    #     Example: Jira Close Issue (Task)
    #     Example: Jira Create Comment


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