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

package v1

import (
	routev1 "github.com/openshift/api/route/v1"
)

// RouteIngressApplyConfiguration represents a declarative configuration of the RouteIngress type for use
// with apply.
//
// RouteIngress holds information about the places where a route is exposed.
type RouteIngressApplyConfiguration struct {
	// host is the host string under which the route is exposed; this value is required
	Host *string `json:"host,omitempty"`
	// Name is a name chosen by the router to identify itself; this value is required
	RouterName *string `json:"routerName,omitempty"`
	// conditions is the state of the route, may be empty.
	Conditions []RouteIngressConditionApplyConfiguration `json:"conditions,omitempty"`
	// Wildcard policy is the wildcard policy that was allowed where this route is exposed.
	WildcardPolicy *routev1.WildcardPolicyType `json:"wildcardPolicy,omitempty"`
	// CanonicalHostname is the external host name for the router that can be used as a CNAME
	// for the host requested for this route. This value is optional and may not be set in all cases.
	RouterCanonicalHostname *string `json:"routerCanonicalHostname,omitempty"`
}

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

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

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

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

// WithWildcardPolicy sets the WildcardPolicy 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 WildcardPolicy field is set to the value of the last call.
func (b *RouteIngressApplyConfiguration) WithWildcardPolicy(value routev1.WildcardPolicyType) *RouteIngressApplyConfiguration {
	b.WildcardPolicy = &value
	return b
}

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