// Code generated by mdatagen. DO NOT EDIT.

package samplereceiver

import (
	"errors"
	"time"

	"go.opentelemetry.io/collector/cmd/mdatagen/internal/samplereceiver/internal/metadata"
)

// Config defines the configuration for Sample Receiver component.
type Config struct {
	metadata.MetricsBuilderConfig `mapstructure:",squash"`
	// The endpoint to scrape metrics from.
	Endpoint string `mapstructure:"endpoint"`
	// Timeout for scraping metrics.
	Timeout time.Duration `mapstructure:"timeout"`
}

// Validate validates the Config fields.
func (c *Config) Validate() error {
	var err error

	if c.Endpoint == "" {
		err = errors.Join(err, errors.New("endpoint is required"))
	}

	return err
}
