{
  "name": "{{ name }}",
  "description": "{{ description | default("") }}",
  "organization": "{{ organization_id | default(None) }}",
  {% if ansible_awx_user_id is defined %}
    "user": "{{ ansible_awx_user_id }}",
  {% endif %}
  {% if team_id is defined %}
    "team": "{{ team_id }}",
  {% endif %}
  "credential_type": "{{ credential_type_id }}",
  {% if credential_type_name == "Machine" %}
  "inputs": {
    "username": "{{ username }}",
    "ssh_public_key_data": "{{ ssh_public_key_data }}",
    "ssh_key_data": "{{ ssh_key_data }}",
    {% if ssh_key_unlock is defined %}
      "ssh_key_unlock": "{{ ssh_key_unlock }}"
    {% endif %}
  }
  {% elif credential_type_name == "Container Registry" %}
  "inputs": {
    "host": "{{ host }}",
    "username": "{{ username }}",
    "password": "{{ password }}"
  }
  {% elif credential_type_name == "Vault" %}
  "inputs": {
    "vault_id": "{{ vault_id | default("") }}",
    "vault_password": "{{ vault_password | default("") }}"
  }
  {% endif %}
}