// SPDX-License-Identifier: AGPL-3.0-only

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

package v0alpha1

import (
	provisioningv0alpha1 "github.com/grafana/grafana/apps/provisioning/pkg/apis/provisioning/v0alpha1"
)

// HealthStatusApplyConfiguration represents a declarative configuration of the HealthStatus type for use
// with apply.
type HealthStatusApplyConfiguration struct {
	// When not healthy, requests will not be executed
	Healthy *bool `json:"healthy,omitempty"`
	// The type of the error
	Error *provisioningv0alpha1.HealthFailureType `json:"error,omitempty"`
	// When the health was checked last time
	Checked *int64 `json:"checked,omitempty"`
	// Summary messages (can be shown to users)
	// Will only be populated when not healthy
	Message []string `json:"message,omitempty"`
}

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

// WithHealthy sets the Healthy 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 Healthy field is set to the value of the last call.
func (b *HealthStatusApplyConfiguration) WithHealthy(value bool) *HealthStatusApplyConfiguration {
	b.Healthy = &value
	return b
}

// WithError sets the Error 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 Error field is set to the value of the last call.
func (b *HealthStatusApplyConfiguration) WithError(value provisioningv0alpha1.HealthFailureType) *HealthStatusApplyConfiguration {
	b.Error = &value
	return b
}

// WithChecked sets the Checked 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 Checked field is set to the value of the last call.
func (b *HealthStatusApplyConfiguration) WithChecked(value int64) *HealthStatusApplyConfiguration {
	b.Checked = &value
	return b
}

// WithMessage adds the given value to the Message 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 Message field.
func (b *HealthStatusApplyConfiguration) WithMessage(values ...string) *HealthStatusApplyConfiguration {
	for i := range values {
		b.Message = append(b.Message, values[i])
	}
	return b
}
