Files
csharp/src/KubernetesClient/generated/Models/V1beta1PolicyRule.cs

130 lines
5.6 KiB
C#
Raw Normal View History

2017-10-19 19:53:02 +00:00
// <auto-generated>
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
2017-10-19 19:53:02 +00:00
// </auto-generated>
namespace k8s.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// PolicyRule holds information that describes a policy rule, but does not
/// contain information about who the rule applies to or which namespace
/// the rule applies to.
/// </summary>
public partial class V1beta1PolicyRule
{
/// <summary>
/// Initializes a new instance of the V1beta1PolicyRule class.
/// </summary>
public V1beta1PolicyRule()
{
2017-10-19 19:53:02 +00:00
CustomInit();
}
/// <summary>
/// Initializes a new instance of the V1beta1PolicyRule class.
/// </summary>
/// <param name="verbs">Verbs is a list of Verbs that apply to ALL the
/// ResourceKinds and AttributeRestrictions contained in this rule.
/// VerbAll represents all kinds.</param>
/// <param name="apiGroups">APIGroups is the name of the APIGroup that
/// contains the resources. If multiple API groups are specified, any
/// action requested against one of the enumerated resources in any API
/// group will be allowed.</param>
/// <param name="nonResourceURLs">NonResourceURLs is a set of partial
/// urls that a user should have access to. *s are allowed, but only
/// as the full, final step in the path Since non-resource URLs are not
/// namespaced, this field is only applicable for ClusterRoles
/// referenced from a ClusterRoleBinding. Rules can either apply to API
/// resources (such as "pods" or "secrets") or non-resource URL paths
/// (such as "/api"), but not both.</param>
/// <param name="resourceNames">ResourceNames is an optional white list
/// of names that the rule applies to. An empty set means that
/// everything is allowed.</param>
/// <param name="resources">Resources is a list of resources this rule
2018-01-27 04:25:58 +08:00
/// applies to. '*' represents all resources in the specified
/// apiGroups. '*/foo' represents the subresource 'foo' for all
/// resources in the specified apiGroups.</param>
public V1beta1PolicyRule(IList<string> verbs, IList<string> apiGroups = default(IList<string>), IList<string> nonResourceURLs = default(IList<string>), IList<string> resourceNames = default(IList<string>), IList<string> resources = default(IList<string>))
{
ApiGroups = apiGroups;
NonResourceURLs = nonResourceURLs;
ResourceNames = resourceNames;
Resources = resources;
Verbs = verbs;
CustomInit();
}
/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();
/// <summary>
/// Gets or sets aPIGroups is the name of the APIGroup that contains
/// the resources. If multiple API groups are specified, any action
/// requested against one of the enumerated resources in any API group
/// will be allowed.
/// </summary>
[JsonProperty(PropertyName = "apiGroups")]
public IList<string> ApiGroups { get; set; }
/// <summary>
/// Gets or sets nonResourceURLs is a set of partial urls that a user
/// should have access to. *s are allowed, but only as the full, final
/// step in the path Since non-resource URLs are not namespaced, this
/// field is only applicable for ClusterRoles referenced from a
/// ClusterRoleBinding. Rules can either apply to API resources (such
/// as "pods" or "secrets") or non-resource URL paths (such as "/api"),
/// but not both.
/// </summary>
[JsonProperty(PropertyName = "nonResourceURLs")]
public IList<string> NonResourceURLs { get; set; }
/// <summary>
/// Gets or sets resourceNames is an optional white list of names that
/// the rule applies to. An empty set means that everything is
/// allowed.
/// </summary>
[JsonProperty(PropertyName = "resourceNames")]
public IList<string> ResourceNames { get; set; }
/// <summary>
/// Gets or sets resources is a list of resources this rule applies to.
2018-01-27 04:25:58 +08:00
/// '*' represents all resources in the specified apiGroups. '*/foo'
/// represents the subresource 'foo' for all resources in the specified
/// apiGroups.
/// </summary>
[JsonProperty(PropertyName = "resources")]
public IList<string> Resources { get; set; }
/// <summary>
/// Gets or sets verbs is a list of Verbs that apply to ALL the
/// ResourceKinds and AttributeRestrictions contained in this rule.
/// VerbAll represents all kinds.
/// </summary>
[JsonProperty(PropertyName = "verbs")]
public IList<string> Verbs { get; set; }
/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
if (Verbs == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Verbs");
}
}
}
}