/// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (ManagedRules == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "ManagedRules");
     }
     if (PolicySettings != null)
     {
         PolicySettings.Validate();
     }
     if (CustomRules != null)
     {
         foreach (var element in CustomRules)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (ApplicationGateways != null)
     {
         foreach (var element1 in ApplicationGateways)
         {
             if (element1 != null)
             {
                 element1.Validate();
             }
         }
     }
     if (ManagedRules != null)
     {
         ManagedRules.Validate();
     }
 }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the WebApplicationFirewallPolicy
 /// class.
 /// </summary>
 /// <param name="id">Resource ID.</param>
 /// <param name="name">Resource name.</param>
 /// <param name="type">Resource type.</param>
 /// <param name="location">Resource location.</param>
 /// <param name="tags">Resource tags.</param>
 /// <param name="policySettings">Describes  policySettings for
 /// policy.</param>
 /// <param name="customRules">Describes custom rules inside the
 /// policy.</param>
 /// <param name="applicationGateways">A collection of references to
 /// application gateways.</param>
 /// <param name="provisioningState">Provisioning state of the
 /// WebApplicationFirewallPolicy.</param>
 /// <param name="resourceState">Resource status of the policy.</param>
 /// <param name="etag">Gets a unique read-only string that changes
 /// whenever the resource is updated.</param>
 public WebApplicationFirewallPolicy(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary <string, string> tags = default(IDictionary <string, string>), PolicySettings policySettings = default(PolicySettings), IList <WebApplicationFirewallCustomRule> customRules = default(IList <WebApplicationFirewallCustomRule>), IList <ApplicationGateway> applicationGateways = default(IList <ApplicationGateway>), string provisioningState = default(string), string resourceState = default(string), string etag = default(string))
     : base(id, name, type, location, tags)
 {
     PolicySettings      = policySettings;
     CustomRules         = customRules;
     ApplicationGateways = applicationGateways;
     ProvisioningState   = provisioningState;
     ResourceState       = resourceState;
     Etag = etag;
     CustomInit();
 }
 /// <summary>
 /// Initializes a new instance of the WebApplicationFirewallPolicy
 /// class.
 /// </summary>
 /// <param name="managedRules">Describes the managedRules
 /// structure</param>
 /// <param name="id">Resource ID.</param>
 /// <param name="name">Resource name.</param>
 /// <param name="type">Resource type.</param>
 /// <param name="location">Resource location.</param>
 /// <param name="tags">Resource tags.</param>
 /// <param name="policySettings">Describes policySettings for
 /// policy.</param>
 /// <param name="customRules">Describes custom rules inside the
 /// policy.</param>
 /// <param name="applicationGateways">A collection of references to
 /// application gateways.</param>
 /// <param name="provisioningState">The provisioning state of the web
 /// application firewall policy resource. Possible values include:
 /// 'Succeeded', 'Updating', 'Deleting', 'Failed'</param>
 /// <param name="resourceState">Resource status of the policy.</param>
 /// <param name="httpListeners">A collection of references to
 /// application gateway http listeners.</param>
 /// <param name="pathBasedRules">A collection of references to
 /// application gateway path rules.</param>
 /// <param name="etag">A unique read-only string that changes whenever
 /// the resource is updated.</param>
 public WebApplicationFirewallPolicy(ManagedRulesDefinition managedRules, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary <string, string> tags = default(IDictionary <string, string>), PolicySettings policySettings = default(PolicySettings), IList <WebApplicationFirewallCustomRule> customRules = default(IList <WebApplicationFirewallCustomRule>), IList <ApplicationGateway> applicationGateways = default(IList <ApplicationGateway>), string provisioningState = default(string), string resourceState = default(string), IList <SubResource> httpListeners = default(IList <SubResource>), IList <SubResource> pathBasedRules = default(IList <SubResource>), string etag = default(string))
     : base(id, name, type, location, tags)
 {
     PolicySettings      = policySettings;
     CustomRules         = customRules;
     ApplicationGateways = applicationGateways;
     ProvisioningState   = provisioningState;
     ResourceState       = resourceState;
     ManagedRules        = managedRules;
     HttpListeners       = httpListeners;
     PathBasedRules      = pathBasedRules;
     Etag = etag;
     CustomInit();
 }