// Code generated by mdatagen. DO NOT EDIT.

package metadata

import (
	"go.opentelemetry.io/collector/confmap"
	"go.opentelemetry.io/collector/filter"
)

// MetricConfig provides common config for a particular metric.
type MetricConfig struct {
	Enabled bool `mapstructure:"enabled"`

	enabledSetByUser bool
}

func (ms *MetricConfig) Unmarshal(parser *confmap.Conf) error {
	if parser == nil {
		return nil
	}
	err := parser.Unmarshal(ms)
	if err != nil {
		return err
	}
	ms.enabledSetByUser = parser.IsSet("enabled")
	return nil
}

// MetricsConfig provides config for awsnvmereceiver metrics.
type MetricsConfig struct {
	DiskioEbsEc2InstancePerformanceExceededIops MetricConfig `mapstructure:"diskio_ebs_ec2_instance_performance_exceeded_iops"`
	DiskioEbsEc2InstancePerformanceExceededTp   MetricConfig `mapstructure:"diskio_ebs_ec2_instance_performance_exceeded_tp"`
	DiskioEbsTotalReadBytes                     MetricConfig `mapstructure:"diskio_ebs_total_read_bytes"`
	DiskioEbsTotalReadOps                       MetricConfig `mapstructure:"diskio_ebs_total_read_ops"`
	DiskioEbsTotalReadTime                      MetricConfig `mapstructure:"diskio_ebs_total_read_time"`
	DiskioEbsTotalWriteBytes                    MetricConfig `mapstructure:"diskio_ebs_total_write_bytes"`
	DiskioEbsTotalWriteOps                      MetricConfig `mapstructure:"diskio_ebs_total_write_ops"`
	DiskioEbsTotalWriteTime                     MetricConfig `mapstructure:"diskio_ebs_total_write_time"`
	DiskioEbsVolumePerformanceExceededIops      MetricConfig `mapstructure:"diskio_ebs_volume_performance_exceeded_iops"`
	DiskioEbsVolumePerformanceExceededTp        MetricConfig `mapstructure:"diskio_ebs_volume_performance_exceeded_tp"`
	DiskioEbsVolumeQueueLength                  MetricConfig `mapstructure:"diskio_ebs_volume_queue_length"`
	DiskioInstanceStorePerformanceExceededIops  MetricConfig `mapstructure:"diskio_instance_store_performance_exceeded_iops"`
	DiskioInstanceStorePerformanceExceededTp    MetricConfig `mapstructure:"diskio_instance_store_performance_exceeded_tp"`
	DiskioInstanceStoreTotalReadBytes           MetricConfig `mapstructure:"diskio_instance_store_total_read_bytes"`
	DiskioInstanceStoreTotalReadOps             MetricConfig `mapstructure:"diskio_instance_store_total_read_ops"`
	DiskioInstanceStoreTotalReadTime            MetricConfig `mapstructure:"diskio_instance_store_total_read_time"`
	DiskioInstanceStoreTotalWriteBytes          MetricConfig `mapstructure:"diskio_instance_store_total_write_bytes"`
	DiskioInstanceStoreTotalWriteOps            MetricConfig `mapstructure:"diskio_instance_store_total_write_ops"`
	DiskioInstanceStoreTotalWriteTime           MetricConfig `mapstructure:"diskio_instance_store_total_write_time"`
	DiskioInstanceStoreVolumeQueueLength        MetricConfig `mapstructure:"diskio_instance_store_volume_queue_length"`
}

func DefaultMetricsConfig() MetricsConfig {
	return MetricsConfig{
		DiskioEbsEc2InstancePerformanceExceededIops: MetricConfig{
			Enabled: false,
		},
		DiskioEbsEc2InstancePerformanceExceededTp: MetricConfig{
			Enabled: false,
		},
		DiskioEbsTotalReadBytes: MetricConfig{
			Enabled: false,
		},
		DiskioEbsTotalReadOps: MetricConfig{
			Enabled: true,
		},
		DiskioEbsTotalReadTime: MetricConfig{
			Enabled: false,
		},
		DiskioEbsTotalWriteBytes: MetricConfig{
			Enabled: false,
		},
		DiskioEbsTotalWriteOps: MetricConfig{
			Enabled: false,
		},
		DiskioEbsTotalWriteTime: MetricConfig{
			Enabled: false,
		},
		DiskioEbsVolumePerformanceExceededIops: MetricConfig{
			Enabled: false,
		},
		DiskioEbsVolumePerformanceExceededTp: MetricConfig{
			Enabled: false,
		},
		DiskioEbsVolumeQueueLength: MetricConfig{
			Enabled: false,
		},
		DiskioInstanceStorePerformanceExceededIops: MetricConfig{
			Enabled: false,
		},
		DiskioInstanceStorePerformanceExceededTp: MetricConfig{
			Enabled: false,
		},
		DiskioInstanceStoreTotalReadBytes: MetricConfig{
			Enabled: false,
		},
		DiskioInstanceStoreTotalReadOps: MetricConfig{
			Enabled: false,
		},
		DiskioInstanceStoreTotalReadTime: MetricConfig{
			Enabled: false,
		},
		DiskioInstanceStoreTotalWriteBytes: MetricConfig{
			Enabled: false,
		},
		DiskioInstanceStoreTotalWriteOps: MetricConfig{
			Enabled: false,
		},
		DiskioInstanceStoreTotalWriteTime: MetricConfig{
			Enabled: false,
		},
		DiskioInstanceStoreVolumeQueueLength: MetricConfig{
			Enabled: false,
		},
	}
}

// ResourceAttributeConfig provides common config for a particular resource attribute.
type ResourceAttributeConfig struct {
	Enabled bool `mapstructure:"enabled"`
	// Experimental: MetricsInclude defines a list of filters for attribute values.
	// If the list is not empty, only metrics with matching resource attribute values will be emitted.
	MetricsInclude []filter.Config `mapstructure:"metrics_include"`
	// Experimental: MetricsExclude defines a list of filters for attribute values.
	// If the list is not empty, metrics with matching resource attribute values will not be emitted.
	// MetricsInclude has higher priority than MetricsExclude.
	MetricsExclude []filter.Config `mapstructure:"metrics_exclude"`

	enabledSetByUser bool
}

func (rac *ResourceAttributeConfig) Unmarshal(parser *confmap.Conf) error {
	if parser == nil {
		return nil
	}
	err := parser.Unmarshal(rac)
	if err != nil {
		return err
	}
	rac.enabledSetByUser = parser.IsSet("enabled")
	return nil
}

// ResourceAttributesConfig provides config for awsnvmereceiver resource attributes.
type ResourceAttributesConfig struct {
	SerialID ResourceAttributeConfig `mapstructure:"SerialId"`
	VolumeID ResourceAttributeConfig `mapstructure:"VolumeId"`
}

func DefaultResourceAttributesConfig() ResourceAttributesConfig {
	return ResourceAttributesConfig{
		SerialID: ResourceAttributeConfig{
			Enabled: true,
		},
		VolumeID: ResourceAttributeConfig{
			Enabled: true,
		},
	}
}

// MetricsBuilderConfig is a configuration for awsnvmereceiver metrics builder.
type MetricsBuilderConfig struct {
	Metrics            MetricsConfig            `mapstructure:"metrics"`
	ResourceAttributes ResourceAttributesConfig `mapstructure:"resource_attributes"`
}

func DefaultMetricsBuilderConfig() MetricsBuilderConfig {
	return MetricsBuilderConfig{
		Metrics:            DefaultMetricsConfig(),
		ResourceAttributes: DefaultResourceAttributesConfig(),
	}
}
