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

package v1

// OperatorHubSpecApplyConfiguration represents a declarative configuration of the OperatorHubSpec type for use
// with apply.
//
// OperatorHubSpec defines the desired state of OperatorHub
type OperatorHubSpecApplyConfiguration struct {
	// disableAllDefaultSources allows you to disable all the default hub
	// sources. If this is true, a specific entry in sources can be used to
	// enable a default source. If this is false, a specific entry in
	// sources can be used to disable or enable a default source.
	DisableAllDefaultSources *bool `json:"disableAllDefaultSources,omitempty"`
	// sources is the list of default hub sources and their configuration.
	// If the list is empty, it implies that the default hub sources are
	// enabled on the cluster unless disableAllDefaultSources is true.
	// If disableAllDefaultSources is true and sources is not empty,
	// the configuration present in sources will take precedence. The list of
	// default hub sources and their current state will always be reflected in
	// the status block.
	Sources []HubSourceApplyConfiguration `json:"sources,omitempty"`
}

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

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

// WithSources adds the given value to the Sources 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 Sources field.
func (b *OperatorHubSpecApplyConfiguration) WithSources(values ...*HubSourceApplyConfiguration) *OperatorHubSpecApplyConfiguration {
	for i := range values {
		if values[i] == nil {
			panic("nil value passed to WithSources")
		}
		b.Sources = append(b.Sources, *values[i])
	}
	return b
}
