// Copyright 2025-Present Datadog, Inc. https://www.datadoghq.com/
// SPDX-License-Identifier: Apache-2.0

/// This file is generated by the scripts/local_config_map_generate.py script.
/// Do not edit this file manually. To add a new configuration,
/// add it to the supported-configurations.json file, then run this script.
#[allow(nonstandard_style)]
#[derive(Debug, PartialEq, Copy, Clone)]
#[non_exhaustive]
pub(crate) enum SupportedConfigurations {
    DD_AGENT_HOST,
    DD_DOGSTATSD_HOST,
    DD_DOGSTATSD_PORT,
    DD_DOGSTATSD_URL,
    DD_ENV,
    DD_INSTRUMENTATION_TELEMETRY_ENABLED,
    DD_LOGS_OTEL_ENABLED,
    DD_LOG_LEVEL,
    DD_METRICS_OTEL_ENABLED,
    DD_REMOTE_CONFIGURATION_ENABLED,
    DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS,
    DD_SERVICE,
    DD_TAGS,
    DD_TELEMETRY_HEARTBEAT_INTERVAL,
    DD_TELEMETRY_LOG_COLLECTION_ENABLED,
    DD_TRACE_AGENT_PORT,
    DD_TRACE_AGENT_URL,
    DD_TRACE_ENABLED,
    DD_TRACE_PARTIAL_FLUSH_ENABLED,
    DD_TRACE_PARTIAL_FLUSH_MIN_SPANS,
    DD_TRACE_PROPAGATION_EXTRACT_FIRST,
    DD_TRACE_PROPAGATION_STYLE,
    DD_TRACE_PROPAGATION_STYLE_EXTRACT,
    DD_TRACE_PROPAGATION_STYLE_INJECT,
    DD_TRACE_RATE_LIMIT,
    DD_TRACE_SAMPLING_RULES,
    DD_TRACE_STATS_COMPUTATION_ENABLED,
    DD_TRACE_X_DATADOG_TAGS_MAX_LENGTH,
    DD_VERSION,
    OTEL_EXPORTER_OTLP_ENDPOINT,
    OTEL_EXPORTER_OTLP_HEADERS,
    OTEL_EXPORTER_OTLP_LOGS_ENDPOINT,
    OTEL_EXPORTER_OTLP_LOGS_HEADERS,
    OTEL_EXPORTER_OTLP_LOGS_PROTOCOL,
    OTEL_EXPORTER_OTLP_LOGS_TIMEOUT,
    OTEL_EXPORTER_OTLP_METRICS_ENDPOINT,
    OTEL_EXPORTER_OTLP_METRICS_HEADERS,
    OTEL_EXPORTER_OTLP_METRICS_PROTOCOL,
    OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE,
    OTEL_EXPORTER_OTLP_METRICS_TIMEOUT,
    OTEL_EXPORTER_OTLP_PROTOCOL,
    OTEL_EXPORTER_OTLP_TIMEOUT,
    OTEL_LOGS_EXPORTER,
    OTEL_METRICS_EXPORTER,
    OTEL_METRIC_EXPORT_INTERVAL,
    OTEL_METRIC_EXPORT_TIMEOUT,
    OTEL_RESOURCE_ATTRIBUTES,

    /// Used for testing purposes only
    #[cfg(test)]
    #[allow(unused)]
    DD_COMPLEX_STRUCT,
    #[cfg(test)]
    #[allow(unused)]
    DD_NONEXISTANT_CONFIGURATION,
    #[cfg(test)]
    #[allow(unused)]
    DD_NONEXISTANT_CONFIGURATION_ALIAS,
    #[cfg(test)]
    #[allow(unused)]
    DD_NONEXISTANT_CONFIGURATION_DEPRECATED,
}

impl SupportedConfigurations {
    pub fn as_str(&self) -> &'static str {
        match self {
            SupportedConfigurations::DD_AGENT_HOST => "DD_AGENT_HOST",
            SupportedConfigurations::DD_DOGSTATSD_HOST => "DD_DOGSTATSD_HOST",
            SupportedConfigurations::DD_DOGSTATSD_PORT => "DD_DOGSTATSD_PORT",
            SupportedConfigurations::DD_DOGSTATSD_URL => "DD_DOGSTATSD_URL",
            SupportedConfigurations::DD_ENV => "DD_ENV",
            SupportedConfigurations::DD_INSTRUMENTATION_TELEMETRY_ENABLED => {
                "DD_INSTRUMENTATION_TELEMETRY_ENABLED"
            }
            SupportedConfigurations::DD_LOGS_OTEL_ENABLED => "DD_LOGS_OTEL_ENABLED",
            SupportedConfigurations::DD_LOG_LEVEL => "DD_LOG_LEVEL",
            SupportedConfigurations::DD_METRICS_OTEL_ENABLED => "DD_METRICS_OTEL_ENABLED",
            SupportedConfigurations::DD_REMOTE_CONFIGURATION_ENABLED => {
                "DD_REMOTE_CONFIGURATION_ENABLED"
            }
            SupportedConfigurations::DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS => {
                "DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS"
            }
            SupportedConfigurations::DD_SERVICE => "DD_SERVICE",
            SupportedConfigurations::DD_TAGS => "DD_TAGS",
            SupportedConfigurations::DD_TELEMETRY_HEARTBEAT_INTERVAL => {
                "DD_TELEMETRY_HEARTBEAT_INTERVAL"
            }
            SupportedConfigurations::DD_TELEMETRY_LOG_COLLECTION_ENABLED => {
                "DD_TELEMETRY_LOG_COLLECTION_ENABLED"
            }
            SupportedConfigurations::DD_TRACE_AGENT_PORT => "DD_TRACE_AGENT_PORT",
            SupportedConfigurations::DD_TRACE_AGENT_URL => "DD_TRACE_AGENT_URL",
            SupportedConfigurations::DD_TRACE_ENABLED => "DD_TRACE_ENABLED",
            SupportedConfigurations::DD_TRACE_PARTIAL_FLUSH_ENABLED => {
                "DD_TRACE_PARTIAL_FLUSH_ENABLED"
            }
            SupportedConfigurations::DD_TRACE_PARTIAL_FLUSH_MIN_SPANS => {
                "DD_TRACE_PARTIAL_FLUSH_MIN_SPANS"
            }
            SupportedConfigurations::DD_TRACE_PROPAGATION_EXTRACT_FIRST => {
                "DD_TRACE_PROPAGATION_EXTRACT_FIRST"
            }
            SupportedConfigurations::DD_TRACE_PROPAGATION_STYLE => "DD_TRACE_PROPAGATION_STYLE",
            SupportedConfigurations::DD_TRACE_PROPAGATION_STYLE_EXTRACT => {
                "DD_TRACE_PROPAGATION_STYLE_EXTRACT"
            }
            SupportedConfigurations::DD_TRACE_PROPAGATION_STYLE_INJECT => {
                "DD_TRACE_PROPAGATION_STYLE_INJECT"
            }
            SupportedConfigurations::DD_TRACE_RATE_LIMIT => "DD_TRACE_RATE_LIMIT",
            SupportedConfigurations::DD_TRACE_SAMPLING_RULES => "DD_TRACE_SAMPLING_RULES",
            SupportedConfigurations::DD_TRACE_STATS_COMPUTATION_ENABLED => {
                "DD_TRACE_STATS_COMPUTATION_ENABLED"
            }
            SupportedConfigurations::DD_TRACE_X_DATADOG_TAGS_MAX_LENGTH => {
                "DD_TRACE_X_DATADOG_TAGS_MAX_LENGTH"
            }
            SupportedConfigurations::DD_VERSION => "DD_VERSION",
            SupportedConfigurations::OTEL_EXPORTER_OTLP_ENDPOINT => "OTEL_EXPORTER_OTLP_ENDPOINT",
            SupportedConfigurations::OTEL_EXPORTER_OTLP_HEADERS => "OTEL_EXPORTER_OTLP_HEADERS",
            SupportedConfigurations::OTEL_EXPORTER_OTLP_LOGS_ENDPOINT => {
                "OTEL_EXPORTER_OTLP_LOGS_ENDPOINT"
            }
            SupportedConfigurations::OTEL_EXPORTER_OTLP_LOGS_HEADERS => {
                "OTEL_EXPORTER_OTLP_LOGS_HEADERS"
            }
            SupportedConfigurations::OTEL_EXPORTER_OTLP_LOGS_PROTOCOL => {
                "OTEL_EXPORTER_OTLP_LOGS_PROTOCOL"
            }
            SupportedConfigurations::OTEL_EXPORTER_OTLP_LOGS_TIMEOUT => {
                "OTEL_EXPORTER_OTLP_LOGS_TIMEOUT"
            }
            SupportedConfigurations::OTEL_EXPORTER_OTLP_METRICS_ENDPOINT => {
                "OTEL_EXPORTER_OTLP_METRICS_ENDPOINT"
            }
            SupportedConfigurations::OTEL_EXPORTER_OTLP_METRICS_HEADERS => {
                "OTEL_EXPORTER_OTLP_METRICS_HEADERS"
            }
            SupportedConfigurations::OTEL_EXPORTER_OTLP_METRICS_PROTOCOL => {
                "OTEL_EXPORTER_OTLP_METRICS_PROTOCOL"
            }
            SupportedConfigurations::OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE => {
                "OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE"
            }
            SupportedConfigurations::OTEL_EXPORTER_OTLP_METRICS_TIMEOUT => {
                "OTEL_EXPORTER_OTLP_METRICS_TIMEOUT"
            }
            SupportedConfigurations::OTEL_EXPORTER_OTLP_PROTOCOL => "OTEL_EXPORTER_OTLP_PROTOCOL",
            SupportedConfigurations::OTEL_EXPORTER_OTLP_TIMEOUT => "OTEL_EXPORTER_OTLP_TIMEOUT",
            SupportedConfigurations::OTEL_LOGS_EXPORTER => "OTEL_LOGS_EXPORTER",
            SupportedConfigurations::OTEL_METRICS_EXPORTER => "OTEL_METRICS_EXPORTER",
            SupportedConfigurations::OTEL_METRIC_EXPORT_INTERVAL => "OTEL_METRIC_EXPORT_INTERVAL",
            SupportedConfigurations::OTEL_METRIC_EXPORT_TIMEOUT => "OTEL_METRIC_EXPORT_TIMEOUT",
            SupportedConfigurations::OTEL_RESOURCE_ATTRIBUTES => "OTEL_RESOURCE_ATTRIBUTES",
            #[cfg(test)]
            SupportedConfigurations::DD_COMPLEX_STRUCT => "DD_COMPLEX_STRUCT",
            #[cfg(test)]
            SupportedConfigurations::DD_NONEXISTANT_CONFIGURATION => "DD_NONEXISTANT_CONFIGURATION",
            #[cfg(test)]
            SupportedConfigurations::DD_NONEXISTANT_CONFIGURATION_ALIAS => {
                "DD_NONEXISTANT_CONFIGURATION_ALIAS"
            }
            #[cfg(test)]
            SupportedConfigurations::DD_NONEXISTANT_CONFIGURATION_DEPRECATED => {
                "DD_NONEXISTANT_CONFIGURATION_DEPRECATED"
            }
        }
    }

    pub fn aliases(&self) -> &[&'static str] {
        match self {
            SupportedConfigurations::DD_REMOTE_CONFIGURATION_ENABLED => {
                &["DD_REMOTE_CONFIG_ENABLED"]
            }
            #[cfg(test)]
            SupportedConfigurations::DD_NONEXISTANT_CONFIGURATION => &[
                "DD_NONEXISTANT_CONFIGURATION_ALIAS",
                "DD_NONEXISTANT_CONFIGURATION_DEPRECATED_ALIAS",
            ],
            _ => &[],
        }
    }

    pub fn is_deprecated(&self) -> bool {
        match self {
            #[cfg(test)]
            SupportedConfigurations::DD_NONEXISTANT_CONFIGURATION_DEPRECATED => true,
            _ => false,
        }
    }
}

pub(crate) fn is_alias_deprecated(name: &str) -> bool {
    match name {
        "DD_REMOTE_CONFIG_ENABLED" => true,
        #[cfg(test)]
        "DD_NONEXISTANT_CONFIGURATION_DEPRECATED_ALIAS" => true,
        _ => false,
    }
}
