/*
Copyright The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

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

package v1alpha1

import (
	v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)

// AdminNetworkPolicyIngressPeerApplyConfiguration represents a declarative configuration of the AdminNetworkPolicyIngressPeer type for use
// with apply.
//
// AdminNetworkPolicyIngressPeer defines a peer to allow traffic to.
//
// Exactly one of the fields must be set for a given peer and this is enforced
// by the validation rules on the CRD. If an implementation sees no fields are
// set then it can infer that the deployed CRD is of an incompatible version
// with an unknown field.  In that case it should fail closed.
//
// For "Allow" rules, "fail closed" means: "treat the rule as matching no
// traffic". For "Deny" and "Pass" rules, "fail closed" means: "treat the rule
// as a 'Deny all' rule".
type AdminNetworkPolicyIngressPeerApplyConfiguration struct {
	// Namespaces defines a way to select all pods within a set of Namespaces.
	// Note that host-networked pods are not included in this type of peer.
	Namespaces *v1.LabelSelectorApplyConfiguration `json:"namespaces,omitempty"`
	// Pods defines a way to select a set of pods in
	// a set of namespaces. Note that host-networked pods
	// are not included in this type of peer.
	Pods *NamespacedPodApplyConfiguration `json:"pods,omitempty"`
}

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

// WithNamespaces sets the Namespaces 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 Namespaces field is set to the value of the last call.
func (b *AdminNetworkPolicyIngressPeerApplyConfiguration) WithNamespaces(value *v1.LabelSelectorApplyConfiguration) *AdminNetworkPolicyIngressPeerApplyConfiguration {
	b.Namespaces = value
	return b
}

// WithPods sets the Pods 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 Pods field is set to the value of the last call.
func (b *AdminNetworkPolicyIngressPeerApplyConfiguration) WithPods(value *NamespacedPodApplyConfiguration) *AdminNetworkPolicyIngressPeerApplyConfiguration {
	b.Pods = value
	return b
}
