Class PolicySettings

java.lang.Object
com.azure.resourcemanager.cdn.models.PolicySettings
All Implemented Interfaces:
com.azure.json.JsonSerializable<PolicySettings>

public final class PolicySettings extends Object implements com.azure.json.JsonSerializable<PolicySettings>
Defines contents of a web application firewall global configuration.
  • Constructor Details

    • PolicySettings

      public PolicySettings()
      Creates an instance of PolicySettings class.
  • Method Details

    • enabledState

      public PolicyEnabledState enabledState()
      Get the enabledState property: describes if the policy is in enabled state or disabled state.
      Returns:
      the enabledState value.
    • withEnabledState

      public PolicySettings withEnabledState(PolicyEnabledState enabledState)
      Set the enabledState property: describes if the policy is in enabled state or disabled state.
      Parameters:
      enabledState - the enabledState value to set.
      Returns:
      the PolicySettings object itself.
    • mode

      public PolicyMode mode()
      Get the mode property: Describes if it is in detection mode or prevention mode at policy level.
      Returns:
      the mode value.
    • withMode

      public PolicySettings withMode(PolicyMode mode)
      Set the mode property: Describes if it is in detection mode or prevention mode at policy level.
      Parameters:
      mode - the mode value to set.
      Returns:
      the PolicySettings object itself.
    • defaultRedirectUrl

      public String defaultRedirectUrl()
      Get the defaultRedirectUrl property: If action type is redirect, this field represents the default redirect URL for the client.
      Returns:
      the defaultRedirectUrl value.
    • withDefaultRedirectUrl

      public PolicySettings withDefaultRedirectUrl(String defaultRedirectUrl)
      Set the defaultRedirectUrl property: If action type is redirect, this field represents the default redirect URL for the client.
      Parameters:
      defaultRedirectUrl - the defaultRedirectUrl value to set.
      Returns:
      the PolicySettings object itself.
    • defaultCustomBlockResponseStatusCode

      public PolicySettingsDefaultCustomBlockResponseStatusCode defaultCustomBlockResponseStatusCode()
      Get the defaultCustomBlockResponseStatusCode property: If the action type is block, this field defines the default customer overridable http response status code.
      Returns:
      the defaultCustomBlockResponseStatusCode value.
    • withDefaultCustomBlockResponseStatusCode

      public PolicySettings withDefaultCustomBlockResponseStatusCode(PolicySettingsDefaultCustomBlockResponseStatusCode defaultCustomBlockResponseStatusCode)
      Set the defaultCustomBlockResponseStatusCode property: If the action type is block, this field defines the default customer overridable http response status code.
      Parameters:
      defaultCustomBlockResponseStatusCode - the defaultCustomBlockResponseStatusCode value to set.
      Returns:
      the PolicySettings object itself.
    • defaultCustomBlockResponseBody

      public String defaultCustomBlockResponseBody()
      Get the defaultCustomBlockResponseBody property: If the action type is block, customer can override the response body. The body must be specified in base64 encoding.
      Returns:
      the defaultCustomBlockResponseBody value.
    • withDefaultCustomBlockResponseBody

      public PolicySettings withDefaultCustomBlockResponseBody(String defaultCustomBlockResponseBody)
      Set the defaultCustomBlockResponseBody property: If the action type is block, customer can override the response body. The body must be specified in base64 encoding.
      Parameters:
      defaultCustomBlockResponseBody - the defaultCustomBlockResponseBody value to set.
      Returns:
      the PolicySettings object itself.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<PolicySettings>
      Throws:
      IOException
    • fromJson

      public static PolicySettings fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of PolicySettings from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of PolicySettings if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IOException - If an error occurs while reading the PolicySettings.