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

package v1

// IngressSpecApplyConfiguration represents a declarative configuration of the IngressSpec type for use
// with apply.
type IngressSpecApplyConfiguration struct {
	Domain               *string                                `json:"domain,omitempty"`
	AppsDomain           *string                                `json:"appsDomain,omitempty"`
	ComponentRoutes      []ComponentRouteSpecApplyConfiguration `json:"componentRoutes,omitempty"`
	RequiredHSTSPolicies []RequiredHSTSPolicyApplyConfiguration `json:"requiredHSTSPolicies,omitempty"`
	LoadBalancer         *LoadBalancerApplyConfiguration        `json:"loadBalancer,omitempty"`
}

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

// WithDomain sets the Domain 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 Domain field is set to the value of the last call.
func (b *IngressSpecApplyConfiguration) WithDomain(value string) *IngressSpecApplyConfiguration {
	b.Domain = &value
	return b
}

// WithAppsDomain sets the AppsDomain 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 AppsDomain field is set to the value of the last call.
func (b *IngressSpecApplyConfiguration) WithAppsDomain(value string) *IngressSpecApplyConfiguration {
	b.AppsDomain = &value
	return b
}

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

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

// WithLoadBalancer sets the LoadBalancer 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 LoadBalancer field is set to the value of the last call.
func (b *IngressSpecApplyConfiguration) WithLoadBalancer(value *LoadBalancerApplyConfiguration) *IngressSpecApplyConfiguration {
	b.LoadBalancer = value
	return b
}
