<!--
  This User README.md is generated by running:
  "resilient-sdk docgen -p {{ name_underscore }} --user-guide"

  It is best edited using a Text Editor with a Markdown Previewer. VS Code
  is a good example. Checkout https://guides.github.com/features/mastering-markdown/
  for tips on writing with Markdown

  If you make manual edits and run docgen again, a .bak file will be created

  Store any screenshots in the "doc/screenshots" directory and reference them like:
  ![screenshot: screenshot_1](./screenshots/screenshot_1.png)
-->

# **User Guide:** {{ name }}_v{{ version }}

## Table of Contents
- [Key Features](#key-features)
{% for fn in functions %}
- [Function - {{ fn.name }}](#function---{{ fn.anchor }})
{% endfor %}
{% for dt in datatables %}
- [Data Table - {{ dt.name }}](#data-table---{{ dt.anchor }})
{% endfor %}
{% if custom_fields %}
- [Custom Fields](#custom-fields)
{% endif %}
{% if custom_artifact_types %}
- [Custom Artifact Types](#custom-artifact-types)
{% endif %}
{% if rules %}
- [Rules](#rules)
{% endif %}

---

## Key Features
<!--
  List the Key Features of the Integration
-->
* Key Feature 1
* Key Feature 2
* Key Feature 3

---

{% for fn in functions %}
## Function - {{ fn.name }}
{{ fn.description }}

 ![screenshot: fn-{{ fn.anchor }} ](./screenshots/fn-{{ fn.anchor }}.png)

<details><summary>Inputs:</summary>
<p>

| Name | Type | Required | Example | Tooltip |
| ---- | :--: | :------: | ------- | ------- |
{% for fn_input in fn.inputs %}
| `{{ fn_input.name }}` | `{{ fn_input.type }}` | {{ fn_input.required }} | `{{ fn_input.placeholder }}` | {{ fn_input.tooltip }} |
{% endfor %}

</p>
</details>

<details><summary>Outputs:</summary>
<p>

```python
results = {
    # TODO: Copy and paste an example of the Function Output within this code block.
    # To view the output of a Function, run resilient-circuits in DEBUG mode and invoke the Function. 
    # The Function results will be printed in the logs: "resilient-circuits run --loglevel=DEBUG"
}
```

</p>
</details>

<details><summary>Workflows</summary>

  <details><summary>Example Pre-Process Script:</summary>
  <p>

  ```python
  {{ fn.pre_processing_script }}
  ```

  </p>
  </details>

  <details><summary>Example Post-Process Script:</summary>
  <p>

  ```python
  {{ fn.post_processing_script }}
  ```

  </p>
  </details>

</details>

---
{% endfor %}

{% for dt in datatables %}
## Data Table - {{ dt.name }}

 ![screenshot: dt-{{ dt.anchor }}](./screenshots/dt-{{ dt.anchor }}.png)

#### API Name:
{{ dt.api_name }}

#### Columns:
| Column Name | API Access Name | Type | Tooltip |
| ----------- | --------------- | ---- | ------- |
{% for col in dt.columns %}
| {{ col.name }} | `{{ col.api_name }}` | `{{ col.type }}` | {{ col.tooltip }} |
{% endfor %}

---
{% endfor %}

{% if custom_fields %}
## Custom Fields
| Label | API Access Name | Type | Prefix | Placeholder | Tooltip |
| ----- | --------------- | ---- | ------ | ----------- | ------- |
{% for f in custom_fields %}
| {{ f.label }} | `{{ f.api_name }}` | `{{ f.type }}` | `{{ f.prefix }}` | {{ f.placeholder }} | {{ f.tooltip }} |
{% endfor %}

---
{% endif %}

{% if custom_artifact_types %}
## Custom Artifact Types
| Display Name | API Access Name | Description |
| ------------ | --------------- | ----------- |
{% for a in custom_artifact_types %}
| {{ a.display_name }} | `{{ a.api_name }}` | {{ a.description }} |
{% endfor %}

---
{% endif %}

{% if rules %}
## Rules
| Rule Name | Object | Workflow Triggered |
| --------- | ------ | ------------------ |
{% for rule in rules %}
| {{ rule.name }} | {{ rule.object_type }} | `{{ rule.workflow_triggered }}` |
{% endfor %}

---
{% endif %}

<!--
## Inform Resilient Users
  Use this section to optionally provide additional information so that Resilient playbook 
  designer can get the maximum benefit of your integration.
-->