{# 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 LabeledMetricType({
    {% 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 %}
{% if lang == "javascript" %}
"use strict";

{% endif %}
/* eslint-disable */

/* 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 has_labeled_metrics %}
import LabeledMetricType from "@mozilla/glean/{{ glean_namespace }}/private/metrics/labeled";
{% endif %}
{% for type in types %}
import {{ type|class_name }} from "@mozilla/glean/{{ glean_namespace }}/private/{{ type|import_path }}";
{% endfor %}


{% for obj in objs.values() %}
/**
 * {{ obj.description|wordwrap() | replace("\n", "\n * ") }}
 *
 * Generated from `{{ obj.identifier() }}`.
 */
{% if obj.labeled %}
export const {{ obj.name|camelize }} = {{ labeled_obj_declaration(obj) }};
{% else %}
export const {{ obj.name|camelize }} = {{ obj_declaration(obj) }};
{% endif %}

{% endfor %}
