CREATE OR REPLACE VIEW {{ catalog }}.{{ schema }}.{{ view.external_id }} AS
SELECT * FROM {{ catalog }}.{{ schema }}.{{ udtf_name }}(
    client_id     => SECRET('{{ secret_scope }}', 'client_id'),
    client_secret => SECRET('{{ secret_scope }}', 'client_secret'),
    tenant_id     => SECRET('{{ secret_scope }}', 'tenant_id'),
    cdf_cluster   => SECRET('{{ secret_scope }}', 'cdf_cluster'),
    project       => SECRET('{{ secret_scope }}', 'project'){% if view.properties %},{% endif %}
{%- for prop_name, prop in view.properties.items() %}
    {{ prop_name }} => NULL{% if not loop.last %},{% endif %}
{%- endfor %}
)

