// Copyright (C) 2025 Rivos Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Autogenerated by the ProtoZero Rust compiler plugin.
// Invoked by contrib/rust-sdk/tools/gen_rust_protos
// DO NOT EDIT.

use crate::pb_enum;
use crate::pb_msg;
use crate::protos::perfetto_sql::structured_query::*;

pb_enum!(TraceMetricV2SpecDimensionType {
    DIMENSION_TYPE_UNSPECIFIED: 0,
    STRING: 1,
    INT64: 2,
    DOUBLE: 3,
    BOOLEAN: 4,
});

pb_enum!(TraceMetricV2SpecDimensionUniqueness {
    DIMENSION_UNIQUENESS_UNSPECIFIED: 0,
    NOT_UNIQUE: 1,
    UNIQUE: 2,
});

pb_enum!(TraceMetricV2SpecMetricUnit {
    METRIC_UNIT_UNSPECIFIED: 0,
    COUNT: 1,
    TIME_NANOS: 2,
    TIME_MICROS: 3,
    TIME_MILLIS: 4,
    TIME_SECONDS: 5,
    TIME_HOURS: 6,
    TIME_DAYS: 7,
    BYTES: 8,
    KILOBYTES: 9,
    MEGABYTES: 10,
    SECONDS_PER_HOUR: 11,
    BOUNDED_PERCENTAGE: 12,
    PERCENTAGE: 13,
    MINUTES_PER_DAY: 14,
    MILLI_AMPS: 15,
    PERCENT_PER_HOUR: 16,
    MILLI_AMP_HOURS: 17,
    PERCENT_PER_HOUR_LEGACY: 18,
    MILLI_WATTS: 19,
    COUNT_PER_SECOND: 20,
    KILOBYTES_PER_HOUR: 21,
    MILLI_WATT_HOURS: 22,
    COUNT_PER_HOUR: 23,
    COUNT_DELTA_PER_HOUR: 24,
    BYTES_DELTA_PER_HOUR: 25,
    CORRELATION_COEFFICIENT: 26,
    MILLI_VOLTS: 27,
    CELSIUS: 28,
    MICRO_AMP_HOURS: 29,
    TIME_MINS: 30,
    DECIBEL_MILLIWATTS: 31,
    KILOBYTES_PER_SECOND: 32,
});

pb_enum!(TraceMetricV2SpecMetricPolarity {
    POLARITY_UNSPECIFIED: 0,
    HIGHER_IS_BETTER: 1,
    LOWER_IS_BETTER: 2,
    NOT_APPLICABLE: 3,
});

pb_msg!(TraceMetricV2Bundle {
    bundle_id: String, primitive, 1,
    row: TraceMetricV2BundleRow, msg, 2,
    specs: TraceMetricV2Spec, msg, 3,
    interned_dimension_bundles: TraceMetricV2BundleInternedDimensionBundle, msg, 4,
});

pb_msg!(TraceMetricV2BundleInternedDimensionBundle {
    interned_dimension_rows: TraceMetricV2BundleInternedDimensionBundleInternedDimensionRow, msg, 2,
});

pb_msg!(TraceMetricV2BundleInternedDimensionBundleInternedDimensionRow {
    key_dimension_value: TraceMetricV2BundleRowDimension, msg, 1,
    interned_dimension_values: TraceMetricV2BundleRowDimension, msg, 2,
});

pb_msg!(TraceMetricV2BundleRow {
    values: TraceMetricV2BundleRowValue, msg, 1,
    dimension: TraceMetricV2BundleRowDimension, msg, 2,
});

pb_msg!(TraceMetricV2BundleRowDimension {
    string_value: String, primitive, 1,
    int64_value: i64, primitive, 2,
    double_value: f64, primitive, 3,
    null_value: TraceMetricV2BundleRowDimensionNull, msg, 4,
    bool_value: bool, primitive, 5,
});

pb_msg!(TraceMetricV2BundleRowDimensionNull {});

pb_msg!(TraceMetricV2BundleRowValue {
    null_value: TraceMetricV2BundleRowValueNull, msg, 1,
    double_value: f64, primitive, 2,
});

pb_msg!(TraceMetricV2BundleRowValueNull {});

pb_msg!(TraceMetricV2TemplateSpec {
    id_prefix: String, primitive, 1,
    dimensions_specs: TraceMetricV2SpecDimensionSpec, msg, 5,
    dimensions: String, primitive, 2,
    value_columns: String, primitive, 3,
    value_column_specs: TraceMetricV2TemplateSpecValueColumnSpec, msg, 8,
    interned_dimension_specs: TraceMetricV2SpecInternedDimensionSpec, msg, 9,
    query: PerfettoSqlStructuredQuery, msg, 4,
    dimension_uniqueness: TraceMetricV2SpecDimensionUniqueness, enum, 6,
    disable_auto_bundling: bool, primitive, 7,
});

pb_msg!(TraceMetricV2TemplateSpecValueColumnSpec {
    name: String, primitive, 1,
    unit: TraceMetricV2SpecMetricUnit, enum, 2,
    custom_unit: String, primitive, 3,
    polarity: TraceMetricV2SpecMetricPolarity, enum, 4,
    display_name: String, primitive, 5,
    display_help: String, primitive, 6,
    doc_link: String, primitive, 7,
});

pb_msg!(TraceMetricV2Spec {
    id: String, primitive, 1,
    dimensions_specs: TraceMetricV2SpecDimensionSpec, msg, 5,
    dimensions: String, primitive, 2,
    value: String, primitive, 3,
    query: PerfettoSqlStructuredQuery, msg, 4,
    dimension_uniqueness: TraceMetricV2SpecDimensionUniqueness, enum, 6,
    unit: TraceMetricV2SpecMetricUnit, enum, 8,
    custom_unit: String, primitive, 9,
    polarity: TraceMetricV2SpecMetricPolarity, enum, 10,
    bundle_id: String, primitive, 7,
    interned_dimension_specs: TraceMetricV2SpecInternedDimensionSpec, msg, 11,
});

pb_msg!(TraceMetricV2SpecInternedDimensionSpec {
    key_column_spec: TraceMetricV2SpecInternedDimensionSpecColumnSpec, msg, 1,
    data_column_specs: TraceMetricV2SpecInternedDimensionSpecColumnSpec, msg, 2,
    query: PerfettoSqlStructuredQuery, msg, 3,
});

pb_msg!(TraceMetricV2SpecInternedDimensionSpecColumnSpec {
    name: String, primitive, 1,
    type: TraceMetricV2SpecDimensionType, enum, 2,
});

pb_msg!(TraceMetricV2SpecDimensionSpec {
    name: String, primitive, 1,
    type: TraceMetricV2SpecDimensionType, enum, 2,
    display_name: String, primitive, 3,
    display_help: String, primitive, 4,
    doc_link: String, primitive, 5,
});
