Class PolicySettings
- java.lang.Object
-
- com.azure.resourcemanager.cdn.models.PolicySettings
-
public final class PolicySettings extends Object
Defines contents of a web application firewall global configuration.
-
-
Constructor Summary
Constructors Constructor Description PolicySettings()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringdefaultCustomBlockResponseBody()Get the defaultCustomBlockResponseBody property: If the action type is block, customer can override the response body.PolicySettingsDefaultCustomBlockResponseStatusCodedefaultCustomBlockResponseStatusCode()Get the defaultCustomBlockResponseStatusCode property: If the action type is block, this field defines the default customer overridable http response status code.StringdefaultRedirectUrl()Get the defaultRedirectUrl property: If action type is redirect, this field represents the default redirect URL for the client.PolicyEnabledStateenabledState()Get the enabledState property: describes if the policy is in enabled state or disabled state.PolicyModemode()Get the mode property: Describes if it is in detection mode or prevention mode at policy level.voidvalidate()Validates the instance.PolicySettingswithDefaultCustomBlockResponseBody(String defaultCustomBlockResponseBody)Set the defaultCustomBlockResponseBody property: If the action type is block, customer can override the response body.PolicySettingswithDefaultCustomBlockResponseStatusCode(PolicySettingsDefaultCustomBlockResponseStatusCode defaultCustomBlockResponseStatusCode)Set the defaultCustomBlockResponseStatusCode property: If the action type is block, this field defines the default customer overridable http response status code.PolicySettingswithDefaultRedirectUrl(String defaultRedirectUrl)Set the defaultRedirectUrl property: If action type is redirect, this field represents the default redirect URL for the client.PolicySettingswithEnabledState(PolicyEnabledState enabledState)Set the enabledState property: describes if the policy is in enabled state or disabled state.PolicySettingswithMode(PolicyMode mode)Set the mode property: Describes if it is in detection mode or prevention mode at policy level.
-
-
-
Method Detail
-
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.
-
-