//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
//
namespace k8s.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
///
/// RunAsGroupStrategyOptions defines the strategy type and any options
/// used to create the strategy.
///
public partial class Policyv1beta1RunAsGroupStrategyOptions
{
///
/// Initializes a new instance of the
/// Policyv1beta1RunAsGroupStrategyOptions class.
///
public Policyv1beta1RunAsGroupStrategyOptions()
{
CustomInit();
}
///
/// Initializes a new instance of the
/// Policyv1beta1RunAsGroupStrategyOptions class.
///
/// rule is the strategy that will dictate the
/// allowable RunAsGroup values that may be set.
/// ranges are the allowed ranges of gids that may
/// be used. If you would like to force a single gid then supply a
/// single range with the same start and end. Required for
/// MustRunAs.
public Policyv1beta1RunAsGroupStrategyOptions(string rule, IList ranges = default(IList))
{
Ranges = ranges;
Rule = rule;
CustomInit();
}
///
/// An initialization method that performs custom operations like setting defaults
///
partial void CustomInit();
///
/// Gets or sets ranges are the allowed ranges of gids that may be
/// used. If you would like to force a single gid then supply a single
/// range with the same start and end. Required for MustRunAs.
///
[JsonProperty(PropertyName = "ranges")]
public IList Ranges { get; set; }
///
/// Gets or sets rule is the strategy that will dictate the allowable
/// RunAsGroup values that may be set.
///
[JsonProperty(PropertyName = "rule")]
public string Rule { get; set; }
///
/// Validate the object.
///
///
/// Thrown if validation fails
///
public virtual void Validate()
{
if (Rule == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Rule");
}
if (Ranges != null)
{
foreach (var element in Ranges)
{
if (element != null)
{
element.Validate();
}
}
}
}
}
}