// Code generated by applyconfiguration-gen. DO NOT EDIT.

package v1

import (
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// InsightsReportApplyConfiguration represents a declarative configuration of the InsightsReport type for use
// with apply.
//
// insightsReport provides Insights health check report based on the most
// recently sent Insights data.
type InsightsReportApplyConfiguration struct {
	// downloadedAt is the time when the last Insights report was downloaded.
	// An empty value means that there has not been any Insights report downloaded yet and
	// it usually appears in disconnected clusters (or clusters when the Insights data gathering is disabled).
	DownloadedAt *metav1.Time `json:"downloadedAt,omitempty"`
	// healthChecks provides basic information about active Insights health checks
	// in a cluster.
	HealthChecks []HealthCheckApplyConfiguration `json:"healthChecks,omitempty"`
}

// InsightsReportApplyConfiguration constructs a declarative configuration of the InsightsReport type for use with
// apply.
func InsightsReport() *InsightsReportApplyConfiguration {
	return &InsightsReportApplyConfiguration{}
}

// WithDownloadedAt sets the DownloadedAt field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DownloadedAt field is set to the value of the last call.
func (b *InsightsReportApplyConfiguration) WithDownloadedAt(value metav1.Time) *InsightsReportApplyConfiguration {
	b.DownloadedAt = &value
	return b
}

// WithHealthChecks adds the given value to the HealthChecks field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the HealthChecks field.
func (b *InsightsReportApplyConfiguration) WithHealthChecks(values ...*HealthCheckApplyConfiguration) *InsightsReportApplyConfiguration {
	for i := range values {
		if values[i] == nil {
			panic("nil value passed to WithHealthChecks")
		}
		b.HealthChecks = append(b.HealthChecks, *values[i])
	}
	return b
}
