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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the defaultCustomBlockResponseBody property: If the action type is block, customer can override the response body.Get the defaultCustomBlockResponseStatusCode property: If the action type is block, this field defines the default customer overridable http response status code.Get the defaultRedirectUrl property: If action type is redirect, this field represents the default redirect URL for the client.Get the enabledState property: describes if the policy is in enabled state or disabled state.static PolicySettingsfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of PolicySettings from the JsonReader.mode()Get the mode property: Describes if it is in detection mode or prevention mode at policy level.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.withDefaultCustomBlockResponseBody(String defaultCustomBlockResponseBody) Set the defaultCustomBlockResponseBody property: If the action type is block, customer can override the response body.withDefaultCustomBlockResponseStatusCode(PolicySettingsDefaultCustomBlockResponseStatusCode defaultCustomBlockResponseStatusCode) Set the defaultCustomBlockResponseStatusCode property: If the action type is block, this field defines the default customer overridable http response status code.withDefaultRedirectUrl(String defaultRedirectUrl) Set the defaultRedirectUrl property: If action type is redirect, this field represents the default redirect URL for the client.withEnabledState(PolicyEnabledState enabledState) Set the enabledState property: describes if the policy is in enabled state or disabled state.withMode(PolicyMode mode) Set the mode property: Describes if it is in detection mode or prevention mode at policy level.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
PolicySettings
public PolicySettings()Creates an instance of PolicySettings class.
-
-
Method Details
-
enabledState
Get the enabledState property: describes if the policy is in enabled state or disabled state.- Returns:
- the enabledState value.
-
withEnabledState
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
Get the mode property: Describes if it is in detection mode or prevention mode at policy level.- Returns:
- the mode value.
-
withMode
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
Get the defaultRedirectUrl property: If action type is redirect, this field represents the default redirect URL for the client.- Returns:
- the defaultRedirectUrl value.
-
withDefaultRedirectUrl
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
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
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
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
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<PolicySettings>- Throws:
IOException
-
fromJson
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.
-