102 lines
4.2 KiB
C#
Generated
102 lines
4.2 KiB
C#
Generated
// <auto-generated>
|
|
// Code generated by https://github.com/kubernetes-client/csharp/tree/master/gen/KubernetesGenerator
|
|
// Changes may cause incorrect behavior and will be lost if the code is
|
|
// regenerated.
|
|
// </auto-generated>
|
|
|
|
namespace k8s.Models
|
|
{
|
|
using Microsoft.Rest;
|
|
using Newtonsoft.Json;
|
|
using System.Collections.Generic;
|
|
using System.Collections;
|
|
using System.Linq;
|
|
|
|
/// <summary>
|
|
/// NetworkPolicyIngressRule describes a particular set of traffic that is allowed
|
|
/// to the pods matched by a NetworkPolicySpec's podSelector. The traffic must match
|
|
/// both ports and from.
|
|
/// </summary>
|
|
public partial class V1NetworkPolicyIngressRule
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the V1NetworkPolicyIngressRule class.
|
|
/// </summary>
|
|
public V1NetworkPolicyIngressRule()
|
|
{
|
|
CustomInit();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Initializes a new instance of the V1NetworkPolicyIngressRule class.
|
|
/// </summary>
|
|
/// <param name="fromProperty">
|
|
/// List of sources which should be able to access the pods selected for this rule.
|
|
/// Items in this list are combined using a logical OR operation. If this field is
|
|
/// empty or missing, this rule matches all sources (traffic not restricted by
|
|
/// source). If this field is present and contains at least one item, this rule
|
|
/// allows traffic only if the traffic matches at least one item in the from list.
|
|
/// </param>
|
|
/// <param name="ports">
|
|
/// List of ports which should be made accessible on the pods selected for this
|
|
/// rule. Each item in this list is combined using a logical OR. If this field is
|
|
/// empty or missing, this rule matches all ports (traffic not restricted by port).
|
|
/// If this field is present and contains at least one item, then this rule allows
|
|
/// traffic only if the traffic matches at least one port in the list.
|
|
/// </param>
|
|
public V1NetworkPolicyIngressRule(IList<V1NetworkPolicyPeer> fromProperty = null, IList<V1NetworkPolicyPort> ports = null)
|
|
{
|
|
FromProperty = fromProperty;
|
|
Ports = ports;
|
|
CustomInit();
|
|
}
|
|
|
|
/// <summary>
|
|
/// An initialization method that performs custom operations like setting defaults
|
|
/// </summary>
|
|
partial void CustomInit();
|
|
|
|
/// <summary>
|
|
/// List of sources which should be able to access the pods selected for this rule.
|
|
/// Items in this list are combined using a logical OR operation. If this field is
|
|
/// empty or missing, this rule matches all sources (traffic not restricted by
|
|
/// source). If this field is present and contains at least one item, this rule
|
|
/// allows traffic only if the traffic matches at least one item in the from list.
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "from")]
|
|
public IList<V1NetworkPolicyPeer> FromProperty { get; set; }
|
|
|
|
/// <summary>
|
|
/// List of ports which should be made accessible on the pods selected for this
|
|
/// rule. Each item in this list is combined using a logical OR. If this field is
|
|
/// empty or missing, this rule matches all ports (traffic not restricted by port).
|
|
/// If this field is present and contains at least one item, then this rule allows
|
|
/// traffic only if the traffic matches at least one port in the list.
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "ports")]
|
|
public IList<V1NetworkPolicyPort> Ports { get; set; }
|
|
|
|
/// <summary>
|
|
/// Validate the object.
|
|
/// </summary>
|
|
/// <exception cref="ValidationException">
|
|
/// Thrown if validation fails
|
|
/// </exception>
|
|
public virtual void Validate()
|
|
{
|
|
if (FromProperty != null){
|
|
foreach(var obj in FromProperty)
|
|
{
|
|
obj.Validate();
|
|
}
|
|
}
|
|
if (Ports != null){
|
|
foreach(var obj in Ports)
|
|
{
|
|
obj.Validate();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|