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

package v1

import (
	operatorv1 "github.com/openshift/api/operator/v1"
)

// RouteAdmissionPolicyApplyConfiguration represents a declarative configuration of the RouteAdmissionPolicy type for use
// with apply.
//
// RouteAdmissionPolicy is an admission policy for allowing new route claims.
type RouteAdmissionPolicyApplyConfiguration struct {
	// namespaceOwnership describes how host name claims across namespaces should
	// be handled.
	//
	// Value must be one of:
	//
	// - Strict: Do not allow routes in different namespaces to claim the same host.
	//
	// - InterNamespaceAllowed: Allow routes to claim different paths of the same
	// host name across namespaces.
	//
	// If empty, the default is Strict.
	NamespaceOwnership *operatorv1.NamespaceOwnershipCheck `json:"namespaceOwnership,omitempty"`
	// wildcardPolicy describes how routes with wildcard policies should
	// be handled for the ingress controller. WildcardPolicy controls use
	// of routes [1] exposed by the ingress controller based on the route's
	// wildcard policy.
	//
	// [1] https://github.com/openshift/api/blob/master/route/v1/types.go
	//
	// Note: Updating WildcardPolicy from WildcardsAllowed to WildcardsDisallowed
	// will cause admitted routes with a wildcard policy of Subdomain to stop
	// working. These routes must be updated to a wildcard policy of None to be
	// readmitted by the ingress controller.
	//
	// WildcardPolicy supports WildcardsAllowed and WildcardsDisallowed values.
	//
	// If empty, defaults to "WildcardsDisallowed".
	WildcardPolicy *operatorv1.WildcardPolicy `json:"wildcardPolicy,omitempty"`
}

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

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