{# The final Javascript/Typescript code is autogenerated, but this
Jinja2 template is not. Please file bugs! #}
{% macro obj_declaration(obj) %}
new {{ obj.type|class_name }}({
    {% for arg_name in (obj.type|args).common if obj[arg_name] is defined %}
    {{ arg_name|camelize }}: {{ obj[arg_name]|js }},
    {% endfor %}
}{% for arg_name in (obj.type|args).extra if obj[arg_name] is defined %}, {{ obj[arg_name]|js }}{% endfor %}){% endmacro %}
{% macro labeled_obj_declaration(obj) %}
new {{ "labeled"|class_name }}({
    {% for arg_name in (obj.type|args).common if obj[arg_name] is defined %}
    {{ arg_name|camelize }}: {{ obj[arg_name]|js }},
    {% endfor %}
}, {{ obj.type|class_name }}{% if obj.labels is not none %}, {{ obj.labels|js }}{% endif %}){% endmacro %}
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// AUTOGENERATED BY glean_parser. DO NOT EDIT. DO NOT COMMIT.

{% if platform != "qt" %}
{% if has_labeled_metrics %}
import LabeledMetricType from "@mozilla/glean/{{ platform }}/private/metrics/labeled";
{% endif %}
{% for type in types %}
import {{ type|class_name }} from "@mozilla/glean/{{ platform }}/private/{{ type|import_path }}";
{% endfor %}
{% else %}
.import org.mozilla.Glean {{ version }} as Glean
{% endif %}
{% for obj in objs.values() %}
/**
 * {{ obj.description|wordwrap() | replace("\n", "\n * ") }}
 *
 * Generated from `{{ obj.identifier() }}`.
 */
{% if obj.labeled %}
{% if platform != "qt" %}export {% endif %}const {{ obj.name|camelize }} = {{ labeled_obj_declaration(obj) }};
{% else %}
{% if platform != "qt" %}export {% endif %}const {{ obj.name|camelize }} = {{ obj_declaration(obj) }};
{% endif %}

{% endfor %}
