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

package v1

// OperatorHubSpecApplyConfiguration represents an declarative configuration of the OperatorHubSpec type for use
// with apply.
type OperatorHubSpecApplyConfiguration struct {
	DisableAllDefaultSources *bool                         `json:"disableAllDefaultSources,omitempty"`
	Sources                  []HubSourceApplyConfiguration `json:"sources,omitempty"`
}

// OperatorHubSpecApplyConfiguration constructs an 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
}
